On Wed, Oct 15, 2014 at 1:16 AM, Eric Brine <ikegami@adaelis.com> wrote: > On Wed, Oct 15, 2014 at 12:30 AM, Marco Moreno <mmoreno@pobox.com> wrote: > >> Using a \Q inside a bracketed character class, should this return true or >> false? This returns "false" for my 5.18.2 and 5.20.0 installs. >> >> perl -e 'print "foo"=~ /\Q[a-z]\E/ ? "true" : "false"' >> > > It's not inside a bracketed class, not that it matters. \Q..\E doesn't > know anything about regular expressions. It escapes non-word characters > after interpolating, so > > /\Q[a-z]\E/ > > is the same thing as > > /\[a\-z\]/ > [Sent by accident. Continuing...] So that makes the documentation wrong/unclear. \Q..\E don't work in character class as the documentation says, but only because it's impossible actually put one in a character class. Its effect already happened as part of the building the string before there even was a character class.Thread Previous