in reply to Efficient run determination.
I am really interested as to how the benchmarking turns out. Let us know.use strict; use Data::Dumper; my $string =' aaaa bbbbccccccccbbbb aaaabbbbbcdddddddddddddddd +dddd'; my @bah; my $old_pos = 0; while ($string =~ /((.)\2*)/g) { push @bah, [$2,$old_pos,length($1)]; $old_pos = pos($string); } print Dumper(\@bah);
Update: It is late, but I just realized i would probably benchmark all the code that turns up on this post anyhow. Once again interesting problem.
Updated Again: Changed the \2+ to \2* or it would have failed when there was a series one character long.
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Efficient run determination.
by Enlil (Parson) on Nov 14, 2002 at 11:42 UTC |