Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Arbitrary number of captures in a regular expression

by sfink (Deacon)
on Sep 24, 2007 at 03:59 UTC ( #640650=note: print w/ replies, xml ) Need Help??


in reply to Arbitrary number of captures in a regular expression

First match the surrounding strings, ending the match just before the "body". Then start just after that header and pull out all the digits.

if (/^foo (?=.*bar$)/g) { @matches = /\Gm (\d+) /g; }


Comment on Re: Arbitrary number of captures in a regular expression
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2015-07-28 06:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls