Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Find repeated patterns in strings

by tlm (Prior)
on Aug 27, 2005 at 17:54 UTC ( [id://487171]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub findCycle {
      my $str = @_ ? shift : '';
      $str =~ /^(.*?)\1*$/;
      return wantarray ? ( length $1, $1 ) : length $1;
    }
    
  2. or download this
        Rate    0    1    2
    0  906/s   -- -58% -85%
    1 2143/s 137%   -- -64%
    2 5966/s 559% 178%   --
    
  3. or download this
        Rate      0      2      1
    0 17.0/s     --   -89%   -99%
    2  155/s   812%     --   -94%
    1 2465/s 14431%  1494%     --
    
  4. or download this
         Rate     2     1     0
    2   222/s    --  -96%  -98%
    1  5023/s 2161%    --  -52%
    0 10479/s 4615%  109%    --
    
  5. or download this
    use strict;
    use warnings;
    ...
      return wantarray ? ( length $1, $1 ) : length $1;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-18 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found