Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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?
[Discipulus]: good morning monks!
[Your Mother]: Mooooooooooorning.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2017-07-21 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (319 votes). Check out past polls.