Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Maybe Escape in Dynamic RegExps

by saintmike (Vicar)
on Apr 30, 2004 at 08:18 UTC ( #349356=note: print w/replies, xml ) Need Help??


in reply to Maybe Escape in Dynamic RegExps

Just escape them via the quotemeta() function or, better yet, using \Q and \E:
$re = qr(/($<!\Q$a\E)\Q$b\E/);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://349356]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2016-12-03 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (56 votes). Check out past polls.