yes, see quotemeta resp. \Q and \E °
>perl $v1 = "*hello"; $v2 = "*hello"; print quotemeta($v2),"\n"; print "match" if $v1 =~ /\Q$v2/; __END__ \*hello match >
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) also perlre#Quoting-metacharacters
In reply to Re: regex matching on metacharacters
by LanX
in thread regex matching on metacharacters
by slugger415
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |