Hmm, never thought of nested tags. Yah I can see where that would burn you if you don't pay attention or do a blind find/replace all. Something I very quickly learned NOT to do unless I am absolutely positive it will be ok.

Version your files, and always do a visual inspection + validate immediately after a replace even though you're sure it will be OK. Regexes are too useful not to be applied to html, even if you might invoke a few elder horrors