Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Efficient run determination.

by Enlil (Parson)
on Nov 14, 2002 at 11:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://212818]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-23 06:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found