Simple perl regular expression help: Searching between a new line?
Posted on 2008-06-10
I am designing an HTML optimizer program, and I want to remove all extra unneeded <b> and </b>'s.
When $html =
And my code snippet is:
while ($html =~ s!</b>(|\s+)<b>! !i)
My output looks like:
... but why was "<b>foo2</b>
<b>bar2</b>" ignored? Doesn't the /s+ mean that it searches for all blank spaces, new lines, etc?