perl -le '$_ = "abcd"; while (/(..)/g) { print $1; --pos }'
Or closer to your exact question:
You might be able to do that in a list-context match with an embedded expression, but that would be too scary for me.perl -le '$_ = "abcdefg"; while (/(...)/g) { print $1; pos($_) -= leng +th($1); pos($_)++ }'
In reply to Re: Regex match iterative grouping
by sfink
in thread Regex match iterative grouping
by SamCG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |