Via a WYSIWYG text editor I insert span tags with a class of “comment”. I want to remove any instances of the span tags and their contents from a string
So how do I get from here:
string content = "<p>sadf<span class="otherclass"><span class="comment">asdfsdafsdafsadfsdf</span></span></p>";
to here:
content = "<p>sadf<span class="otherclass"></span></p>";
I know about the HTMLAgilityPack but don’t want to add the overhead for HTML that I control. I perfer a regex solution.
EDIT: I only want to remove spans with the “comment” class.
Inadequate answer: