Problems? Is your data what you think it is? | |
PerlMonks |
Re: regex exerciseby choroba (Cardinal) |
on Aug 02, 2016 at 22:42 UTC ( [id://1169053]=note: print w/replies, xml ) | Need Help?? |
/m isn't needed, as you don't use ^ or $ in the regex. /i isn't needed, either, as <p> is always lowercase in the sample data. I also used s%%% instead of s/// to avoid the need to backslash the slashes in endtags.
Explanation: The p-tag must be followed by two newlines that aren't preceded by its endtag. You can make the regex more readable via /x :
Update: or even
In Section
Seekers of Perl Wisdom
|
|