The Perl regular expression engine starts the next match always after the last matched character of the previous match. So you will need lookahead assertions (?= that don't adjust pos if you don't want to fiddle with pos yourself (see perlre on lookahead assertions):
perl -le "$_='1234';@x=/(?=(\d\d))/g;print for @x"
In reply to Re: Global regexp
by Corion
in thread Global regexp
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |