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

Re: How do I extract named variable names from regex string

by chessgui (Scribe)
on Jan 30, 2012 at 14:02 UTC ( #950777=note: print w/ replies, xml ) Need Help??


in reply to How do I extract named variable names from regex string

Note that a-z+ should be [a-z]+ and the second '+' refers only to the character '>'.

my @names; while( $string=~s/\?<([a-z]+)>// ){push(@names,$1);} print "Names: ",join(',',@names),"\n";


Comment on Re: How do I extract named variable names from regex string
Select or Download Code
Re^2: How do I extract named variable names from regex string
by toolic (Bishop) on Jan 30, 2012 at 14:20 UTC
    This is the confusion which results when someone does not use code tags. The OP actually did use [a-z]+, as can be seen when clicking on the xml link, but it rendered poorly.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2015-07-03 06:26 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 (48 votes), past polls