Thread: Regex examples
View Single Post
Old 01-12-2015, 11:14 AM   #458
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by JSWolf View Post
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.
The reason it won't do anything... is because there is no empty tag set, span or otherwise.
eschwartz is offline   Reply With Quote