Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: qr for recursive regex?

by Limbic~Region (Chancellor)
on May 28, 2014 at 19:20 UTC ( [id://1087707]=note: print w/replies, xml ) Need Help??


in reply to Re^2: qr for recursive regex?
in thread qr for recursive regex?

darisler,
If you use a regex with the global modifier in scalar context, you will get an iterator allowing you to go through each set of matches one at a time (like one of the examples above):
while ($str =~ m{$your_regex}g) { my ($x, $y) = ($1, $2); # This loop will repeat for as many matches as are in $str }

Cheers - L~R

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found