Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Regex match inside quotes doesn't work

by choroba (Abbot)
on Sep 09, 2013 at 09:31 UTC ( #1052989=note: print w/ replies, xml ) Need Help??


in reply to Regex match inside quotes doesn't work

$search contains backslashes that should not be interpreted as special characters. Use \Q to quote the special characters:

if (not $string =~ s/\Q$search/$replace/) {

Note that / can be used as the delimiter, since neither the pattern nor the replacement contain literal slashes.

لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Regex match inside quotes doesn't work
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-08-21 18:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (142 votes), past polls