in reply to Extended Regular Expressions

If what you want is to the right of the first > can't you just print $'  or the English $POSTMATCH after the first print statement?

E.g.,

print $& if /^<a href.*>[^\z])/; print $';
Update: Sorry, overlooked that somehow.

If the code and the comments disagree, then both are probably wrong. -- Norm Schryer

Replies are listed 'Best First'.
Re: Re: Extended Regular Expressions
by Hofmator (Curate) on Aug 16, 2001 at 18:07 UTC

    print $& if /^<a href.*>[^\z]/; print $';
    This does not work - as jroberts already pointed out - because the first letter after the closing angle bracket is eaten as well. So it's not printed with $POSTMATCH.

    Furthermore the regex contained an additional closing parenthesis - this was already in the original post and just a copy and paste error. I fixed that above.

    -- Hofmator