in reply to regular expression with @@/
Your code is fine. Both \Q and \ will escape @.
$ perl -le'print q{@@} =~ m|\A\Q@@\E\z| ? "match" : "no match"' match $ perl -le'print q{@@} =~ m|\A\@\@\z| ? "match" : "no match"' match
Are you sure your input is what you think it is?
Update: Turns out that \Q only helps insofar as @@ doesn't get interpolated to begin with.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regular expression with @@/
by almut (Canon) on Dec 07, 2009 at 19:22 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 19:38 UTC |