I'm tired. My brain hurts. There must be something I've overlooked in perldoc perlvar. Can anyone explain the difference, if there is one, between merlyn's solution
push @matches, [$-[1], $+[1]] while $string =~ /(?=($regex))/g;and this, which I came up with myself (heavily adapted, but... :):
push @matches, [$-[0], $+[1]] while $string =~ /(?=($regex))/g;thx
dave
In reply to Re: positions of all regexp matches
by Not_a_Number
in thread positions of all regexp matches
by glwtta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |