Given this text:
<span class='green'>foobar</span> something <span class='red'>fizzle</span>
I need to somehow attain this:
<tagA>foobar</tagA> something <tabB>fizzle</tagB>
I basically have to match <span class='green'>*anything*</span> and be able to differentiate it from the red one as well. I have to take this green span on both ends and replace it with a fixed string, but somehow retain whatever text is between the two tags.
I swear I've looked around a ton but have no idea how to find the solution for this with regex.
<span class='green'><span class='green'>foo</span>foobar<span class='green'>bar</span></span>? ;).