in reply to Regular Expression Problem
I think what you were trying to accomplish is:
$remainder =~ s/<a[^>]*>//i;
That won't remove the end tag or the stuff in between though.
You might want to look at HTML::LinkExtor, HTML::Parser, and HTML::TokeParser to do these kind of things reliably.
Update: due to the discussion below, it dawned on me that I need a \b in order to avoid removing abbr tags (and one or two others that start with an "a".)
$remainder =~ s/<a\b[^>]*>//i;
the_pusher_robot++ for the clue.
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regular Expression Problem
by the pusher robot (Monk) on Aug 29, 2002 at 03:15 UTC | |
by sauoq (Abbot) on Aug 29, 2002 at 04:18 UTC |