in reply to finding number of contiguous letters
I'm starting to think that I might need to use a while loop that uses a counter to substring the word and then increment its starting point by one until the end of the string.
That was my first thought, and probably how I'd do it. Here's another way that might entertain you,
We need to keep subtracting one less than the length of the match from pos to match the overlapping strings.local $_ = 'computer'; my @results; pos() -= 2, push @results, $1 while /(...)/g; print "@results", $/;
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: finding number of contiguous letters
by otto (Beadle) on May 23, 2007 at 16:13 UTC | |
by blazar (Canon) on May 23, 2007 at 20:03 UTC | |
by otto (Beadle) on May 24, 2007 at 00:04 UTC | |
by blazar (Canon) on May 24, 2007 at 10:32 UTC | |
by otto (Beadle) on May 25, 2007 at 00:27 UTC | |
| |
|
Re^2: finding number of contiguous letters
by Marknel (Acolyte) on May 23, 2007 at 04:50 UTC |