Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match a single byte \C doesn't work in character class #8840

Closed
p5pRT opened this issue Mar 19, 2007 · 6 comments
Closed

match a single byte \C doesn't work in character class #8840

p5pRT opened this issue Mar 19, 2007 · 6 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 19, 2007

Migrated from rt.perl.org#41916 (status was 'rejected')

Searchable as RT41916$

@p5pRT
Copy link
Author

p5pRT commented Mar 19, 2007

From cdl@genome.stanford.edu

This is a bug report for perl from cdl@​best.com,
generated with the help of perlbug 1.35 running under perl v5.8.6.

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
This also appears to be the case under Perl 5.8.8

I've no personal need for this to be fixed, I'm simply trying to
characterize in a technical note which character class abbreviations
work inside m/[]/ and which do not. These two seem inconsistent with
the rest. So, a simple confirmation that this is a bug or a
misunderstanding on my part is sufficient. Thank you!


Flags​:
  category=core
  severity=low


Site configuration information for perl v5.8.6​:

Configured by root at Thu Nov 2 10​:35​:22 PST 2006.

Summary of my perl5 (revision 5 version 8 subversion 6) configuration​:
  Platform​:
  osname=darwin, osvers=8.0, archname=darwin-thread-multi-2level
  uname='darwin b07.apple.com 8.0 darwin kernel version 8.3.0​: mon
oct 3 20​:04​:04 pdt 2005; root​:xnu-792.6.22.obj~2release_ppc power
macintosh powerpc '
  config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -
Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
  useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
  use64bitint=undef use64bitall=undef uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-g -pipe -fno-common -DPERL_DARWIN -no-cpp-
precomp -fno-strict-aliasing -I/usr/local/include',
  optimize='-Os',
  cppflags='-no-cpp-precomp -g -pipe -fno-common -DPERL_DARWIN -no-
cpp-precomp -fno-strict-aliasing -I/usr/local/include'
  ccversion='', gccversion='3.3 20030304 (Apple Computer, Inc.
build 1819)', gccosandvers=''
  intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
  ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-L/usr/
local/lib'
  libpth=/usr/local/lib /usr/lib
  libs=-ldbm -ldl -lm -lc
  perllibs=-ldl -lm -lc
  libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true,
libperl=libperl.dylib
  gnulibc_version=''
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
  cccdlflags=' ', lddlflags='-bundle -undefined dynamic_lookup -L/
usr/local/lib'

Locally applied patches​:
  23953 - fix for File​::Path​::rmtree CAN-2004-0452 security issue
  33990 - fix for setuid perl security issues
  SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962


@​INC for perl v5.8.6​:
  /sw/lib/perl5/5.8.6/darwin-thread-multi-2level
  /sw/lib/perl5/5.8.6
  /sw/lib/perl5
  /sw/lib/perl5/darwin
  /System/Library/Perl/5.8.6/darwin-thread-multi-2level
  /System/Library/Perl/5.8.6
  /Library/Perl/5.8.6/darwin-thread-multi-2level
  /Library/Perl/5.8.6
  /Library/Perl
  /Network/Library/Perl/5.8.6/darwin-thread-multi-2level
  /Network/Library/Perl/5.8.6
  /Network/Library/Perl
  /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level
  /System/Library/Perl/Extras/5.8.6
  /Library/Perl/5.8.1
  .


Environment for perl v5.8.6​:
  DYLD_LIBRARY_PATH (unset)
  HOME=/Volumes/Users HD/cdl
  LANG (unset)
  LANGUAGE (unset)
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/sw/bin​:/sw/sbin​:.​:/Users/cdl/bin​:/usr/bin​:/bin​:/usr/local/
bin​:/sbin​:/usr/sbin​:/etc​:/opt/local/bin​:/opt/local/sbin​:/usr/X11R6/bin
  PERL5LIB=/sw/lib/perl5​:/sw/lib/perl5/darwin
  PERL_BADLANG (unset)
  SHELL=/bin/csh

@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2007

From @rgarcia

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.

@p5pRT
Copy link
Author

p5pRT commented Mar 20, 2007

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2016

From @khwilliamson

Thanks for submitting this report. However, it has been overtaken by events. The decision has been made to remove \C entirely. (This was supposed to be done for 5.24, but slipped through the cracks, so will be done in 5.26) So there is no need to document something that is about to go away.
--
Karl Williamson

@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2016

@khwilliamson - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed Mar 10, 2016
@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2016

From @khwilliamson

On 03/10/2016 11​:01 AM, Karl Williamson via RT wrote​:

Thanks for submitting this report. However, it has been overtaken by events. The decision has been made to remove \C entirely. (This was supposed to be done for 5.24, but slipped through the cracks, so will be done in 5.26) So there is no need to document something that is about to go away.

I should have been clearer. The ticket wasn't actually proposing that
\C be added to bracketed character classes. As the response indicated,
that doesn't really make sense. But rather that we document that it
doesn't work in those classes. No one bothered to do this, and now
there is no point to doing so, as it is about to become a syntax error,
and we don't want to encourage its use in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant