Use \E to stop the quoting.

-----Original Message-----
From: Jeremy Kister [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 28, 2006 1:01 PM
To: beginners@perl.org
Subject: regex quoting

perldoc -q quote talks about \Q before a regex to escape special
characters.

how do you use \Q when you want to anchor the regex with a dollar sign ?


my $string = my $regex = "foo";
print "match\n" if($string =~ /^\Q${regex}$/);


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to