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

Re^2: Regex: Searching for a string with special characters

by Hofmator (Curate)
on Nov 03, 2006 at 10:26 UTC ( #582045=note: print w/replies, xml ) Need Help??


in reply to Re: Regex: Searching for a string with special characters
in thread Regex: Searching for a string with special characters

And another option is to use the qr/$string/ syntax, which you can find in perlop.

Just a small annotation. This is only correct if it is supposed to be a general comment. The qr/$string/ construct has no influence on the escape issue whatsoever.

For the escaping see also quotemeta.

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^3: Regex: Searching for a string with special characters
by Anonymous Monk on Nov 03, 2006 at 13:37 UTC

    Thanks a lot.

    As mentioned by you, 'qr' didn't work for me but I was able to get the desired results using 'quotemeta'.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582045]
help
Chatterbox?
[stevieb]: I'm learning that no matter how good a piece of software is at what it's supposed to do, it's a piece of shit without providing any API documentation. (Talking about C++ here currently). Seriously... write software for an embedded platform and make...
[stevieb]: ...you guess based on the sparse examples, and the header files that are spread out illogically?
[stevieb]: document the public facing functions/methods people... ALL OF THEM.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-05-28 23:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?