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

Re^4: Regex help

by moritz (Cardinal)
on May 06, 2009 at 11:53 UTC ( [id://762238]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Regex help
in thread Regex help

It doesn't make a difference, but if you want to write something after the variable, it's treated literally unless there's an \E. That's a common mistake I made, so I always haven an \E for every \Q.

Example:

$ perl -Mre=debug -e 'my $x= "*"; /\Q$x.+/' Compiling REx "\*\.\+" Final program: 1: EXACT <*.+> (3) 3: END (0) anchored "*.+" at 0 (checking anchored isall) minlen 3 Freeing REx: "\*\.\+"
You see that the .+ is also treated literally.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-03-28 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found