Quoting James Mcclure <perlbug-followup@perl.org>: > > # perl zero-length regex bug > > # instructions: > # 1) run with $ARGV[0] = 1, this script prints false > # 2) run with $ARGV[0] = 2, this script prints true > # 3) comment out the $ARGV[0] =~ /1/ line --> this script prints true > $ARGV[0] =~ /1/; > if ( '' =~ // ) { print "true\n"; } > else { print "false\n"; } > > ----------------------------------------------------------------- Hello, Thank you for your bug report but this is not a bug. If you use an empty pattern after a re then it uses the pattern of the last succesful match. It is mentioned in http://perldoc.perl.org/perlretut.html#Using-regular-expressions-in-Perl But perhaps it could/should be documented more clearly... (I can't easily find it in perlre for example - or atleast not using a basic search) Kind regards, BramThread Previous | Thread Next