Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by roboticus (Chancellor)
on Dec 21, 2013 at 18:10 UTC ( [id://1068047]=note: print w/replies, xml ) Need Help??


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

Special_K:

The URL part is always constant, so instead *just* capture the filenames, then build the URLs:

if (@filename = ($_ =~ /$test_regexp/g)) { my @complete_urls = map { "http://...." . $_ } @filename; ... }

Alternatively, capture the URL and split off the filenames:

if (@complete_urls = ($_ =~ /$test_regexp/g)) { my @filename = map { s{^.*/}{}; $_ } @complete_urls; ... }

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-18 07:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found