For examle:
<div id="outer">
<div id="a">
<div class="b"> 11111111111</div>
<div class="b"> 22222222222222</div>
</div>
</div>
Now I want to match the elements of id is a
, and replace it to empty, but I found I can't, because id="a"
is not the outer div.
This is my c# code ,it will match the last Tag.
Regex regex = new Regex(@"<div id=""a([\s\S]*) (<\/[div]>+)");