Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Metacharacters in a variable as literals in regex

by flounder99 (Friar)
on Oct 09, 2003 at 12:23 UTC ( [id://297892]=note: print w/replies, xml ) Need Help??


in reply to Metacharacters in a variable as literals in regex

There is also quotemeta. Which does the same thing as \Q ... \E but outside the m//.
$quotedregex = quotemeta $unquotedregex; m/$quotedregex/;

--

flounder

Log In?
Username:
Password:

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

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

    No recent polls found