Quote:
Originally Posted by 1v4n0
How about a regex that finds everything that has the structure of
<AAA whatever></AAA>
i.e. all empty html elements.
Or, even better, all elements that either are empty or that contain just a space.
EDIT Looks like this one is working, though I'm not entirely sure why.
Code:
<[^/>]+>[ \n\r\t]*</[^>]+>
|
Don't use this. It won't work. Sorry, but you cannot guarantee that it won't mess something up.
Take a look at the following line...
<p><span>This is some text.<span class="smallcaps">THIS IS MORE TEXT</span>. This is yet more text.</span> And finally the last bit of text.</p>
Can you use regex to get rid of the empty span without messing up the span that actually does something? I don't see how you can.