develooper Front page | perl.perl5.porters | Postings from March 2007

Re: [perl #41916] match a single byte \C doesn't work in character class

Thread Previous
From:
Rafael Garcia-Suarez
Date:
March 19, 2007 17:14
Subject:
Re: [perl #41916] match a single byte \C doesn't work in character class
Message ID:
b77c1dce0703191713u3dd6d1crd07ef56920a64b4e@mail.gmail.com
On 19/03/07, via RT Christopher Lane <perlbug-followup@perl.org> wrote:
> The following prints "yes" (ie. works)
>
> perl -we 'print(("a" =~ m/\C/) ? "yes" : "no", "\n")'
>
> But this (added [] around \C) prints a warning and doesn't work
> (prints "no")
>
> perl -we 'print(("a" =~ m/[\C]/) ? "yes" : "no", "\n")'
> Unrecognized escape \C in character class passed through in regex;
> marked by <-- HERE in m/[\C <-- HERE ]/ at -e line 1.
>
> I tested this with and without 'use charnames'
> This also appears to be the case with \X

I'm not sure that \C or \X would be useful, or would even make sense,
in character classes. But that doesn't seem to be documented in
perlre.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About