Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 (Chancellor) 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 surveying the Monastery: (13)
As of 2014-11-29 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls