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

5.005_57: Regex behaves incorrectly #42

Closed
p5pRT opened this issue Jun 3, 1999 · 3 comments
Closed

5.005_57: Regex behaves incorrectly #42

p5pRT opened this issue Jun 3, 1999 · 3 comments

Comments

@p5pRT
Copy link

@p5pRT p5pRT commented Jun 3, 1999

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

Searchable as RT844$

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Jun 3, 1999

From @mjdominus

This should print `!!!' before it does anything else, and in this case
the regex should match. (It's a slightly modified version of the
regex from page 200 of _Perl Cookbook_; it should match any string
that does not end in `foo'.

However, it doesn't match, and it doesn't print `!!!' either.

If I remove the $ from the end of the regex, it prints `!!!'.
If I remove (?{print "$2 "}) from the middle, it prints `!!!'.
If I change the target string from `xf' to `x', it prints `!!!'.

Summary of my perl5 (revision 5.0 version 5 subversion 57) configuration​:
  Platform​:
  osname=linux, osvers=2.0.35, archname=i586-linux
  uname='linux plover 2.0.35 #2 mon oct 26 21​:26​:00 cst 1998 i586 unknown '
  config_args='-Doptimize=-g -des'
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  use64bits=undef usemultiplicity=undef
  Compiler​:
  cc='cc', optimize='-g', gccversion=egcs-2.90.29 980515 (egcs-1.0.3 release)
  cppflags='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
  ccflags ='-Dbool=char -DHAS_BOOL -DDEBUGGING -I/usr/local/include'
  stdchar='char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
  alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /shlib /lib /usr/lib
  libs=-lndbm -lgdbm -ldbm -ldb -ldl -lm -lc
  libc=/lib/libc-2.0.7.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
  cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Characteristics of this binary (from libperl)​:
  Compile-time options​: DEBUGGING
  Built under linux
  Compiled at May 25 1999 16​:00​:13
  @​INC​:
  /usr/local/lib/perl5/5.00557/i586-linux
  /usr/local/lib/perl5/5.00557
  /usr/local/lib/perl5/site_perl/5.00557/i586-linux
  /usr/local/lib/perl5/site_perl/5.00557
  .

Mark-Jason Dominus mjd@​plover.com

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 20, 2000

From [Unknown Contact. See original ticket]

Mark,

The code you gave​:

  #!/usr/bin/perl -w

  $z = ("xf" =~ m{^
  (?{print "!!!\n"})
  (
  (
  (?!foo$ )
  .
  ) (?{print "$2 "})
  *
  )
  $
  }x);

  print "$z\n";

now emits a warning (in 5.6-RC2)​:

(?{print "$2 "})
*
matches null string many times at /tmp/asdf line 13.

I don't know whether this helps your code or reflects a different
bug :-)

Nat

@p5pRT
Copy link
Author

@p5pRT p5pRT commented Mar 20, 2000

From @mjdominus

Mark,

The code you gave​:

The warning makes sense, and I can't imagine what possessed me to put a
* there. Can you send me some private email to remind me of the
context?

@p5pRT p5pRT closed this Nov 28, 2003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant