in reply to Re: Regular Expression Problem
in thread Regular Expression Problem

Actually, you want:
$remainder =~ s/<a\s[^>]*>//i;
(makes sure you only get a, not abbr, acronym, etc.)

Update: now that I think about it, why not just: $remainder =~ s/<a\s.*?>//i; ?

Update the second: d'oh... good catch, sauoq. How about $remainder =~ s/<a(>|\s.*?>)//i; ? Or is there a better way to do it?

Replies are listed 'Best First'.
Re: Re: Re: Regular Expression Problem
by sauoq (Abbot) on Aug 29, 2002 at 04:18 UTC
    Actually, you want: . . .

    Actually, that's not what I want. Yours misses an anchor tag without attributes. As far as I know <A></A> is legal even if it isn't particularly useful. If you can show me that it isn't, I'll add the \s next time.

    I will concede that I need a \b though. :-)

    -sauoq
    "My two cents aren't worth a dime.";