in reply to Re: Efficient run determination.
in thread Efficient run determination.

Second Try. I am going off to bed after this, my benchmarking tells me this is faster than my previous try:
use strict; use Data::Dumper; my $string =' aaaa bbbbccccccccbbbb aaaabbbbbcdddddddddddddddd +dddd'; my @bah; while ($string =~ /((.)\2*)/g) { push (@bah, [$2,$-[1],$+[1] - $-[1]]); } print Dumper(\@bah);

Update Changed the \2+ to \2* or it would have failed when there was a series one character long.

-enlil