Don't ask to ask, just ask | |
PerlMonks |
Re: Maybe Escape in Dynamic RegExpsby halley (Prior) |
on May 02, 2004 at 14:10 UTC ( [id://349816]=note: print w/replies, xml ) | Need Help?? |
The \Q and \E is the correct answer; the quotemeta() function is the equivalent function.
However, for perl5 anyway, a useful rule of thumb is that alphanumeric characters need escapes to be special, and everything else need escapes to be normal. There are a lot of non-alphanumeric characters that the escaping would be redundant but not harmful (such as \=). --
In Section
Seekers of Perl Wisdom
|
|