|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Is there a nicer way to do regex search and replace with literal backslashes?by moritz (Cardinal) |
| on Apr 14, 2012 at 21:19 UTC ( #965093=note: print w/ replies, xml ) | Need Help?? |
|
I don't quite understand what you want to do and why you're doing it in such a complicated way, but \Q$needle\E escaping inside a regex will probably help you. See perlre for details.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||