I'm stripping out all style attributes from some html. I could use the regex
/style=("[^"]"|'[^']')/
But I wonder if this is inefficient (due to the negative matching). I also know it's vulnerable to style attributes (e.g. background-image) that can contain quotes.
Is there a regex I can use to match valid style strings or, like parsing html with regex, is this a task too difficult for a regex to perform in general?
*edit Here is (I think) the trickiest style string in the html I'm scraping
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Verdana','sans-serif'; mso-fareast-font-family: 'Times New Roman'"