I'd also go with tachyon's suggestion of HTML Tidy, but if you are trying to do this quick and dirty somewhere in the middle of a script, I'd use this regex $text =~ s#<\s*([^>]*)\s*>[\s\n]*<\s*/\s*\1\s*>##ig; It should remove any empty tags which don't contain any attributes (not just bold tags), so it works on
__DATA__ <i> </ I> < B ></b> < em> < / eM >
In reply to Re: how-to strip empty HTML tags like b /b
by Hofmator
in thread how-to strip empty HTML tags like <b> </b>
by russmann
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |