I have lots of text marked up like this:
<span class="section">[<a href="blablabla">Section</a>]</span>
I need to remove everything that has class=”section” including span tags and text inside it. I’m looking for a regex or an alternativeto automate this task.
Any clues?
edit: Im up to anything that helps me solve this, i thought regex was the easier way. i’m coding in PHP.
Thanks.
If your section-class tags don’t contain elements of the same type (e.g. you do not have spans containing spans) you can do this quite easily with a regex.
The following is the simplest:
This, if you need it, allows for any tag, any other attributes, and any other classes: