regex - Invert match with regular expressions -
how exclude style attribute html string regular expressions?
for example if have following inline html string:
<html><body style="background-color:yellow"><h2 style="background-color:red">this heading</h2><p style="background-color:green">this paragraph.</p></body></html>
when apply regular expression matching, matched result should like:
<html><body ><h2 >this heading</h2><p >this paragraph.</p></body></html>
you can't parse html regular expressions because html not regular.
of course can cut corners @ own peril, example searching style\s*=\s*"[^"]*"
, replacing nothing, remove any occurence of style="anything"
text.
Comments
Post a Comment