Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Efficient run determination.

by Enlil (Parson)
on Nov 14, 2002 at 11:42 UTC ( #212818=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://212818]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2019-05-20 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (123 votes). Check out past polls.

    Notices?