Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Arbitrary number of captures in a regular expression

by Sidhekin (Priest)
on Sep 25, 2007 at 11:06 UTC ( #640897=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my (@match) = $str =~ /(?:^foo (?=(?:m \d+ )+bar)|(?<!^)\G)m (\d+) /g;
    
  2. or download this
    my (@match) = $str =~
      / (?: ^foo\ (?= (?:m\ \d+\ )+bar) # overall match from ^foo
    ...
        )
        m\ (\d+)\                       # grab each digit sequence
      /xg;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-04-19 06:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls