but, what if I don't want the position to set to after the last match, but to one character after the beginning of the last match to produce ab,bc,cd,de,ef,fg? I've tried a few strange variants of adding code into the expression to alter the 'abcdefg' midway, but these don't seem to produce the results I want.perl -e "@re='abcdefg'=~/(..)/g;print join ',', @re;" #prints ab,cd,ef
No particular purpose here other than just to wield regexes better, so if there are practical reasons this is ludicrous feel free to tell me.perl -e "$_='abcdefg';@re=/(..)(?{reverse;chop;reverse;})/g;print join + ',', @re;" ab,cd, perl -e "$_='abcdefg';@re=/(..)(?{$_=substr($_,1)})/g;print join ',', +@re;" bc,ef,
In reply to Regex match iterative grouping by SamCG
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |