in reply to Re: How can I delete characters between < and > in Perl?
in thread How can I delete characters between < and > in Perl?

needs to be non-greedy $text =~ s!<[^>]+?>!!g;

Replies are listed 'Best First'.
Re^3: How can I delete characters between < and > in Perl?
by kyle (Abbot) on Apr 18, 2009 at 16:39 UTC

    What's the difference? The character class ([^>]) is never going to accidentally slurp up closing hoinkies anyway.

Re^3: How can I delete characters between < and > in Perl?
by Your Mother (Archbishop) on Apr 18, 2009 at 16:44 UTC

    That is incorrect. That's part of the reason for using negated match classes. It cannot over-match.