Note that using + instead * is not equivalent.
$ perl -e'$_ = "Hello"; print "<$1>\n" while /(?=(.*))/g;' <Hello> <ello> <llo> <lo> <o> <> $ perl -e'$_ = "Hello"; print "<$1>\n" while /(?=(.+))/g;' <Hello> <ello> <llo> <lo> <o>
In reply to Re^2: Regex bug in 5.10 (was: Using Look-ahead and Look-behind)
by ikegami
in thread Using Look-ahead and Look-behind
by Roy Johnson
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |