i have this regex:
/\<p(.+?|)>(.+?)<\/p\>/ims
which matches all the <p> inside an .html doc. However sometimes the <p> has attributes (like class, style, id etc.. ) and sometimes it doesn't.
The problem with this regex is if the <p> has no attributes it matches the closing tag of the.
here is an example: