Longest match bug in perl5? 
Author Message
 Longest match bug in perl5?

I get the following in perl5 beta 3b shouldn't * also match the
longest possible string?
insanus[2]perl5  
$str = "abcdef";
$str =~ /(?:(?!ab)[a-z])+/;
print "Match: $&\n";
$str =~ /(?:(?!ab)[a-z])*/;
print "Match: $&\n";
^D
Match: bcdef
Match:

--

                            Torsten Ekedahl



Sat, 15 Mar 1997 00:15:34 GMT  
 Longest match bug in perl5?

: I get the following in perl5 beta 3b shouldn't * also match the
: longest possible string?
: insanus[2]perl5  
: $str = "abcdef";
: $str =~ /(?:(?!ab)[a-z])+/;
: print "Match: $&\n";
: $str =~ /(?:(?!ab)[a-z])*/;
: print "Match: $&\n";
: ^D
: Match: bcdef
: Match:

Looks like a bug to me.

Larry



Mon, 24 Mar 1997 03:56:57 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl5.001: bug in regexp matching

2. regexp match bug in perl5

3. Pattern bug matching whitespace in multi-line match?

4. Pattern matching optimizing question (long, with code)

5. Match longest or shortest substring?

6. Splitting long match patterns

7. longer pattern matches

8. regex and longest match

9. how long is a {0,m} match?

10. seg fault when matching long string

11. Longest match

12. Why does this match take so long?

 

 
Powered by phpBB® Forum Software