Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
more useful options
 
PerlMonks  

Re: Golf (Inspired): Repeated Phrases

by chipmunk (Parson)
on May 10, 2001 at 19:51 UTC ( #79444=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub repeated {
    my@p;$_=pop()-1 for$m,$n;
    $_[1]=~($~=$1.$2)&&push@p,$~while$_[0]=~/(\w+)(?=(( \w+){$n,$m}))/g;
    @p
    }
    
  2. or download this
    sub repeated {
    my@p;$m=pop;$n=pop;
    $_[1]=~$1&&push@p,$&while$_[0]=~/\b(?=((\w+\b ?){$n,$m}))/g;
    @p
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-04-20 09:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls