Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: multiple matches per line *AND* multiple capture groups per match

by educated_foo (Vicar)
on Dec 21, 2013 at 23:25 UTC ( #1068068=note: print w/replies, xml ) Need Help??


in reply to Re: multiple matches per line *AND* multiple capture groups per match
in thread multiple matches per line *AND* multiple capture groups per match

This. Your solution is fine, but you need to do a bit of postprocessing, e.g.
if (@groups = /$test_regexp/g) { while (@groups) { ($url, $file) = splice @groups, 0, 2; # ... } }
or use a loop:
while (/$test_regexp/g) { ($url, $file) = ($1, $2); # ... }

Replies are listed 'Best First'.
Re^3: multiple matches per line *AND* multiple capture groups per match
by Special_K (Beadle) on Dec 22, 2013 at 01:41 UTC
    Thanks, that also solves my problem.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1068068]
help
Chatterbox?
[marto]: Discipulus Let's discuss Podmaster's Signature and the response from tye
[Discipulus]: thanks marto i'll read it after an urgent phonecall
[choroba]: I configured signature font to 2pt size, so I don't care
[choroba]: Moreover, I don't find the Big Lebowski quote offensive
Lady_Aleena wishes she could format her signature a bit without getting metaphorical hives.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2017-06-23 09:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (539 votes). Check out past polls.