go ahead... be a heretic | |
PerlMonks |
Re^3: Variable matching on a regexby johngg (Canon) |
on Jun 17, 2010 at 13:42 UTC ( [id://845198]=note: print w/replies, xml ) | Need Help?? |
You could adapt the code in this node, pushing captures onto an array rather than concatenating them onto a scalar string. It uses regular expression recursion so there are actually two patterns involved rather than one "fixed" regex but the actual match is done just the once without a g flag. Obviously, the global match already shown is a much simpler solution. I hope this is of interest. Cheers, JohnGG
In Section
Seekers of Perl Wisdom
|
|