If keeping regexes simple is one of your objectives, then another strategy would be to match all and then discard mis-aligned matches.
use strict; use warnings; my $str = 'AAA451BBB512CCC123DDD234EEE345FFF45'; while( $str =~ /((.)\2\2)/g ) { next unless $-[1] % 5 < 3; print "Found $1\n"; }
In reply to Re: Regex matching on grid alignment
by hdb
in thread Regex matching on grid alignment
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |