0

I have this example html - string html="<span id="x" style="color:#000000;">aaaaa</span>" I am trying this to get html without the style:

string clean = Regex.Replace(html, "style=\\?\"[^\"]*\\?\"", "");

the regex should also target <span id="x" style=\"color:#000000;\">aaaaa</span> In this case the result inside clean is the same as html Any thought?

kleinohad
  • 5,800
  • 2
  • 26
  • 34
  • Rather than regex can you use HTML parser, remove the styling, and then stream it? – n8wrl Sep 13 '17 at 15:32
  • 1
    Relevant: https://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 – Max Play Sep 13 '17 at 15:33

0 Answers0