Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Using string literal in regexp

by sh1tn (Priest)
on Jun 16, 2006 at 17:43 UTC ( [id://555842]=note: print w/replies, xml ) Need Help??


in reply to Using string literal in regexp

You should use qr operator.
If the character is special one, escape it with '\'.
You may want to read this manual - perlre


Replies are listed 'Best First'.
Re^2: Using string literal in regexp
by chromatic (Archbishop) on Jun 17, 2006 at 07:32 UTC

    I don't think this is helpful.

    How does qr// help? Interpolation happens there too!

    How do you perform generalized backslash escaping on an arbitrary string? Do you run it through another regex first? Do you recreate the behavior of quotemeta or \Q...\E then, perhaps badly?

    davorg has given far better advice.

Log In?
Username:
Password:

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

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

    No recent polls found