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

[19990603.010] 5.005_57: Regex behaves incorrectly

Thread Next
From:
Nathan Torkington
Date:
March 20, 2000 20:16
Subject:
[19990603.010] 5.005_57: Regex behaves incorrectly
Message ID:
14550.63179.521986.654726@prometheus.frii.com
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

Thread Next


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