in reply to Re^2: Code does Remove Html
in thread Code does Remove Html

But what about tags like these?

Replies are listed 'Best First'.
Re^4: Code does Remove Html
by SFLEX (Chaplain) on Dec 17, 2006 at 15:18 UTC
    your right the code /<(([^ >]|\n)*)>/ / does not remove those two.
    But the one code i posted
    $value =~ s/<(([^ >]|\n|\s\w)*)>/ /gso; will remove the <a href="http://perlmonks.org" class="link">
    and if you added |\s\/ will remove the <br />.

    Like.

    $value =~ s/<(([^ >]|\n|\s\w|\s\/)*)>/ /gso;
    I just came up with it and its not 100% tested. But it does the trick. :D

    Updated: Could try $value =~ s/<(([^ >]|\n|\s\/|\s\S\S)*)>/ /gso;
    But Escaping is Much Better!