|
|
| P is for Practical | |
| PerlMonks |
Answer: How do I escape metacharacters in a user-defined string? |
| ( #21919=categorized answer: print w/ replies, xml ) | Need Help?? |
|
Q&A > regular expressions > How do I escape metacharacters in a user-defined string? contributed by Perlmage
You could also use quotemeta(), which is how the \Q is implemented. Ie.,
This will handle literal '$' and '@'.
|
|
||||||||||||||||||