$_ = '<a href= ?a=500011&w=2&r=1 >firstname.lastname@example.org</a>'
print $& if /^<a href.*>[^\z])/;
print $& if /^<a href.*>(?=[^\z])/x;
the 1st print prints
"<a href= ?a=500011&w=2&r=1 >j"
the 2nd print prints the entire string "$_". why is that? This is under Activestate perl 5.6.1 for winNT. What i really want is the stuff to the right of the 1st '>' character. the stuff to the left of the 1st '>' is too unpredictable to allow a flexible approach to stop the .* from "eating up" everything until the very last '>'.
The 1st statment stops the .* but $' does not include the 'j' from "joe" and thus $' is not correct for my purposes. I thought the extended zero-width lookahead would solve my problem but it doesn't act like i expect.
With the exception of the values of $' and $&, shouldn't those expressions have the same results?
Thanks in advance