Hi,
I'm trying to match html strings using grep commend and I'm not able to eliminate the extra spaces. This is working when there is no space. Can anyone help me what am I missing here?
I'm able to match KayDee
where there is no space.
grep commands tried:
grep -P -o -e '(?<=<span>[^ ]*<span>[^ ]*)(.*?)(?<=<\/span>)' htmlpage
grep -P -o -e '(?<=<span>[[:space:]]*<span>[[:space:]]*)(.*?)(?<=<\/span>)' htmlpage
HTML code :
With space :
<span>
<span>
KayDee
</span>
Without space :
<span><span>KayDee</span>