in reply to Elegant (i.e. declarative) way to find all possibly overlapping matches
As long as you're looking for literal strings instead of regex matches,
The increment in the loop is important.my $spot = 0; while (($spot = index $s, 'aa', $spot) != -1) { printf "found aa at %d\n", $spot++; }
After Compline,
Zaxo
|
---|