Alternatively,
while ('AAAA' =~ /A(?=A)/g) { $count++; }
which looks slightly less weird to me.
In reply to Re^2: counting overlapping patterns
by ikegami
in thread counting overlapping patterns
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |