Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Maybe Escape in Dynamic RegExps

by gellyfish (Monsignor)
on Apr 30, 2004 at 08:19 UTC ( #349357=note: print w/replies, xml ) Need Help??


in reply to Maybe Escape in Dynamic RegExps

The simplest way would be to use the \Q and \E in the expression:

$re= qr(/($<!\Q$a\E)\Q$b/);
and it will do the right thing.

/J\

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-02-22 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (335 votes). Check out past polls.