Re: regex quoting

2006-07-28 Thread John W. Krahn
Jeremy Kister wrote: > 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}$/); print "match\n" if $string =

RE: regex quoting

2006-07-28 Thread Timothy Johnson
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

Re: regex quoting

2006-07-28 Thread Rob Dixon
Jeremy Kister wrote: > > 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}$/); \E marks the end of the string

Re: regex quoting

2006-07-28 Thread Mumia W.
On 07/28/2006 03:01 PM, Jeremy Kister wrote: 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}$/); \E enables nor

Re: regex quoting

2006-07-28 Thread Tom Phoenix
On 7/28/06, Jeremy Kister <[EMAIL PROTECTED]> wrote: how do you use \Q when you want to anchor the regex with a dollar sign? I think you're looking for \E, which "ends" the section of the string quoted via \Q. Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail:

regex quoting

2006-07-28 Thread Jeremy Kister
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}$/); -- Jeremy Kister http://jeremy.kister.net./ -- To unsubscribe