Try
[0] Perl> $s = "Input String: aaAabBAAa";; [0] Perl> $n=1; print "'$1'" while $s =~ m[(?=((.)\2{$n}))]ig;; 'aa' 'aA' 'Aa' 'bB' 'AA' 'Aa' [0] Perl> $n=2; print "'$1'" while $s =~ m[(?=((.)\2{$n}))]ig;; 'aaA' 'aAa' 'AAa'
In reply to Re: Is there an elegant way of resetting the match position?
by BrowserUk
in thread Is there an elegant way of resetting the match position?
by pat_mc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |