Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: delayed variable interpolation in a regular expression

by SamCG (Hermit)
on Apr 25, 2006 at 16:03 UTC ( #545596=note: print w/replies, xml ) Need Help??


in reply to Re^2: delayed variable interpolation in a regular expression
in thread delayed variable interpolation in a regular expression

David, you were correct the first time and your second example is fine. ] can be the first character in a class without being escaped.

H:\>perl -e "$_='a';/[]a]/?print 'Y':print 'N'" Y H:\>
On an XP box (which is why you see the reversed quote notation). I also believe you're absolutely correct about the hyphen being acceptable as the last character (it's not "underscore to nothing").


-----------------
s''limp';@p=split '!','n!h!p!';s,m,s,;$s=y;$c=slice @p1;so brutally;d;$n=reverse;$c=$s**$#p;print(''.$c^chop($n))while($c/=$#p)>=1;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2022-08-09 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?