"so the second match would never occur, even if the code compiled because the first match would have swallowed everying in your (then-current) line of data."
Not so!
use v5.10; my $email = 'foo <bar>'; $email =~ /(.*) (<.*>)/; say "1='$1' 2='$2'";
Greedy matches don't automatically swallow everything. A quote from perlre, my emphasis:
"By default, a quantified subpattern is "greedy", that is, it will match as many times as possible (given a particular starting location) while still allowing the rest of the pattern to match."
In reply to Re^2: perl 5.10 bug or not?
by tobyink
in thread perl 5.10 bug or not?
by sotona
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |