good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: multiple matches per line *AND* multiple capture groups per matchby johngg (Canon) |
on Dec 21, 2013 at 19:39 UTC ( [id://1068052]=note: print w/replies, xml ) | Need Help?? |
You can use a ternary to push onto either the complete URL array or the filename array. To save space I have simplified the URLs and pattern but the principle would still hold for your data. Things would get more complicated if your URLs broke across lines.
I hope this is helpful. Update: Corrected unescaped dot in regex and added (?x) extended syntax to space things out for readability. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|