Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Nested grouping or capturing inside capturing

by remiah (Hermit)
on Nov 23, 2011 at 13:40 UTC ( #939659=note: print w/ replies, xml ) Need Help??


in reply to Nested grouping or capturing inside capturing

Named back reference save your ($4 || $3), but I wonder this is elegant or not.

print "$1-$2-$+{third}\n" if m/ (\w+)\s (\w+)\s (?: "(?<third>[^"]+)" | (?<third>\w+)) /x;


Comment on Re: Nested grouping or capturing inside capturing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2015-07-02 06:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (29 votes), past polls