I have an html page with multiple <span class="classa">
but I need to remove only the ones that have an opening {
, zero or more characters and then a closing }
like in the example below:
<span class="classa">
<span class="classb">{</span>
<a href="some link" title="some title">some text</a>
<span class="classb">}</span>
</span>
For example if I have something like this:
<span class="classa">
<span class="classb">{</span>
<a href="some link" title="some title">some text</a>
<span class="classb">}</span>
</span>
then the entire <span class="classa">
and it's children should be removed
but if I have this:
<span class="classa">
something here
<span class="classb">{</span>
or something here
<a href="some link" title="some title">some text</a>
<span class="classb">}</span>
or something here
</span>
then nothing should be touched.
How do I do this ? should I write a regex ?