Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: \U, \E and friends interpolation in regex operators

by l.frankline (Hermit)
on Dec 14, 2005 at 04:15 UTC ( [id://516515]=note: print w/replies, xml ) Need Help??


in reply to \U, \E and friends interpolation in regex operators

Hi,

when you store Escaping characters like \U, \E, \u and so on... in a scalar variable, avoid using single quote instead of double quote, because the regex can't recognise the Escaping characters. If you do like $var = '\utext' the regex will interpolate. here is an example. try this:

print my $var = "\utext"; "Text" =~ m/$var/ && print "matches\n";

Regards,
Franklin

Don't put off till tomorrow, what you can do today.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-19 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found