in reply to Re^2: Remove all html tag Except 'sup'
in thread Remove all html tag Except 'sup'

Its missing a grouping parens
# you need extra (?:) $tag = qr{</?(?:(?!sup)[^>])*>}i;

Replies are listed 'Best First'.
Re^4: Remove all html tag Except 'sup'
by waldner (Beadle) on Jun 20, 2008 at 11:51 UTC
    That will also keep <supfoo> and <foosup>. A partial improvement may be
    $tag = qr{</?(?:(?![< ]sup[ >])[^>])*>}i;
    It works, however I'm not terribly sure about why it works...