I've got a bunch of HTML pages, in which I'd like to convert CSS-formatted text snippets into standard HTML tags. e.g <span class="bold">some text</span>
will become <b>some text</b>
I'm stuck at nested span
fragments:
<span class="italic"><span class="bold">XXXXXXXX</span></span>
<span class="italic">some text<span class="bold">nested text<span class="underline">deep nested text</span></span></span>
I'd like to convert the fragment using Python's regex library. What would be the optimal strategy to regex search-&-replace the above input?