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

regex fails on a literal following n times quantifier #930

Closed
p5pRT opened this issue Dec 9, 1999 · 3 comments
Closed

regex fails on a literal following n times quantifier #930

p5pRT opened this issue Dec 9, 1999 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 9, 1999

Migrated from rt.perl.org#1873 (status was 'resolved')

Searchable as RT1873$

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 1999

From boigy@casc.com

Created by boigy@lucent.com

The following code fragment incorrectly fails regular expression match
(it does match successfully in 5.00401)​:

  $_="16 00 00 00 06 00 00 00 00 00 00 00 00 00 1F 00 ";
  /^(([A-F0-9u][A-F0-9u] ){4} ){4} *$/;

For comparison, the following fragment does appear to work
(replaces a literal space with a '.' metacharacter)​:

  $_="16 00 00 00 06 00 00 00 00 00 00 00 00 00 1F 00 ";
  /^(([A-F0-9u][A-F0-9u] ){4}.){4} *$/;

Perl Info


Site configuration information for perl 5.00503:

Configured by boigy at Mon Oct 25 16:44:26 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos distinct 5.5.1 generic_103640-24 sun4u sparc sunw,ultra-5_10 '
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.6.3
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00503:
    /software/switch/tools/lib/perl5/5.00503/sun4-solaris
    /software/switch/tools/lib/perl5/5.00503
    /software/switch/tools/lib/perl5/site_perl/5.005/sun4-solaris
    /software/switch/tools/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00503:
    HOME=/home/boigy
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/lib:/opt/software/tools/amc/master/lib:/usr/dt/lib::/usr/dt/lib:/usr/openwin/lib:/opt/IXImd12s/lib:/opt/SUNWmotif/lib:/usr/4lib:/opt/NeWSprint/lib:/opt/software/X11R6/lib:/opt/software/X11R5/lib:/opt/software/clarify/lib:/home/boigy/lib:/home/boigy/lib/rvplayer5.0:/software/switch/tools/mri960/master/lib
    LOGDIR (unset)
    PATH=/usr/atria/bin:/usr/atria/local:/home/boigy/bin:/usr/bin:/usr/openwin/bin:/usr/sbin:/usr/ucb:/bin:/opt/SUNWmotif/bin:/etc:/opt/software/X11R6/bin:/opt/software/tools/bin:/usr/ccs/bin:/home/boigy/bin/hosts:/software/switch/tools/bin:/software/switch/tools/mri960/bin:/opt/software/tools/amc/master/mwbin:/software/switch/tools/crash/bin:/software/switch/tools/bin:/software/switch/tools/mri960/bin:/opt/software/tools/amc/master/bin:/opt/software/tools/amc/master/mwbin:/opt/software/tools/snav40/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh


Site configuration information for perl 5.00503:

Configured by boigy at Mon Oct 25 16:44:26 EDT 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=solaris, osvers=2.5.1, archname=sun4-solaris
    uname='sunos distinct 5.5.1 generic_103640-24 sun4u sparc sunw,ultra-5_10 '
    hint=previous, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.6.3
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches:
    


@INC for perl 5.00503:
    /software/switch/tools/lib/perl5/5.00503/sun4-solaris
    /software/switch/tools/lib/perl5/5.00503
    /software/switch/tools/lib/perl5/site_perl/5.005/sun4-solaris
    /software/switch/tools/lib/perl5/site_perl/5.005
    .


Environment for perl 5.00503:
    HOME=/home/boigy
    LANG=C
    LANGUAGE (unset)
    LD_LIBRARY_PATH=/usr/lib:/opt/software/tools/amc/master/lib:/usr/dt/lib::/usr/dt/lib:/usr/openwin/lib:/opt/IXImd12s/lib:/opt/SUNWmotif/lib:/usr/4lib:/opt/NeWSprint/lib:/opt/software/X11R6/lib:/opt/software/X11R5/lib:/opt/software/clarify/lib:/home/boigy/lib:/home/boigy/lib/rvplayer5.0:/software/switch/tools/mri960/master/lib
    LOGDIR (unset)
    PATH=/usr/atria/bin:/usr/atria/local:/home/boigy/bin:/usr/bin:/usr/openwin/bin:/usr/sbin:/usr/ucb:/bin:/opt/SUNWmotif/bin:/etc:/opt/software/X11R6/bin:/opt/software/tools/bin:/usr/ccs/bin:/home/boigy/bin/hosts:/software/switch/tools/bin:/software/switch/tools/mri960/bin:/opt/software/tools/amc/master/mwbin:/software/switch/tools/crash/bin:/software/switch/tools/bin:/software/switch/tools/mri960/bin:/opt/software/tools/amc/master/bin:/opt/software/tools/amc/master/mwbin:/opt/software/tools/snav40/bin
    PERL_BADLANG (unset)
    SHELL=/bin/tcsh

@p5pRT
Copy link
Author

p5pRT commented Dec 9, 1999

From [Unknown Contact. See original ticket]

Thomas Seidenberg writes​:

The following code fragment incorrectly fails regular expression match
(it does match successfully in 5.00401)​:

$_="16 00 00 00 06 00 00 00 00 00 00 00 00 00 1F 00 ";
/^(([A-F0-9u][A-F0-9u] ){4} ){4} *$/;

Thanks, This is an already reported bug in REx sniffer​:
-Mre=debugcolor reports​:

anchored ` ' at 2 floating `'$ at 52..2147483647 (checking anchored noscan) anchored(BOL) minlen 52

As you can see, it thinks that the substring ' ' should appear at
offset 2 (instead of 11). Moreover, it misses a better substring
' ' at offset 46.

This bug appears with non-variable {n} only.

Ilya

@p5pRT
Copy link
Author

p5pRT commented Jul 17, 2000

From @vanstyn

Way back, Thomas Seidenberg (boigy@​lucent.com) wrote​:
:The following code fragment incorrectly fails regular expression match
:(it does match successfully in 5.00401)​:
:
: $_="16 00 00 00 06 00 00 00 00 00 00 00 00 00 1F 00 ";
: /^(([A-F0-9u][A-F0-9u] ){4} ){4} *$/;

I note that this is fixed by the recent patch to perl-5.6.0​:
  http​://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-07/msg00491.html

Hugo

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