It prints [a] [bc]. The regexp engine clearly doesn't run through all possible combinations within (..|..|..) patterns.$_='abcdefgh'; /^(a|abcdefg)(h|bc)/; print "[$1] [$2]\n";
In reply to Re^2: Greedy regexp matching: differences between man page and implementation?
by perldeveloper
in thread Greedy regexp matching: differences between man page and implementation?
by stijnvs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |