Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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";

Replies are listed 'Best First'.
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?
LanX 1 ..2 ..3 ..4 .. is erix missing ;-)
LanX is Discipulus reciting "Springtime for Hitler" ?
[choroba]: erix could tell you how to do it in Postgres
[LanX]: NOOOOOOOOOOOOOOO not again
[chacham]: wow, mysql really is as bad as i thougt
[choroba]: completion?
[LanX]: That's what he usually does when MySQL is mentioned ;-)
[chacham]: the same thing could be achieved with a trigger
[LanX]: choroba yes
chacham shudders at the thought of using a trigger...so evil

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (12)
As of 2017-03-30 15:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (360 votes). Check out past polls.