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 =
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
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
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
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:
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