Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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/);


Comment on Re: Maybe Escape in Dynamic RegExps
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2014-12-28 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls