in reply to Remove all html tag Except 'sup'

Let me see ... what do you expect to get from this?

Some text. <script language="JavaScript"> function foo() { ... } </script> blah blah blah.
Does the regexp handle this? blah <input type="text" name="foo" value="paul > martin">
What about this: foo <!-- comment 10<start --> blah <sup>
What about all kinds of different things you can find in HTML?

Forget regexps ... the regexp that would strip everything you need and keep everything you need would be insanely complex. And I would not believe it anyway. Use a module. Eg.

use HTML::JFilter; #http://jenda.krynicky.cz/#HTML::JFilter my $filter = new HTML::JFilter <<'*END*' sup *END* $filteredHTML = $filter->doSTRING($enteredHTML);