I have an HTML string from which I want to strip a specific div and all of its content based on some condition my div has a specific class and it contains some other nested divs in there. I have tried to use regex but the problem is that it picks up the first </div>
and ignores the following content.
string html = "<div class=\"card-set--six manual-cardset\"><div>test string</div></div>";
html = new Regex("<div class=\"card-set--six manual-cardset\">.*?</div>").Replace(html, string.Empty);
In my case, it should remove all the content and I should get an empty string. But this regex is returning me </div>
.