develooper Front page | perl.perl5.porters | Postings from July 2008

[perl #56690] Some bugs in Perl regexp (core Perl issues)

Thread Next
July 8, 2008 08:01
[perl #56690] Some bugs in Perl regexp (core Perl issues)
Message ID:
# New Ticket Created by  Serge 
# Please include the string:  [perl #56690]
# in the subject line of all future correspondence about this issue. 
# <URL: >


 I have found some simple and unpleasant bugs in Perl regexp:

print "Match" if 'ab' =~ /^a?(?=b)b/;    # Not match, but must...

 Also you can replace ^ with \A, and ? with *.

 Here are bugs similar to the above:

print $& if 'ab' =~ /a?(?=b)b/;
print $& if 'ab' =~ /a*(?=b)b/;

 Both operators print b, but must print ab.

 Here is my bug report at ActiveState:

Sincerely yours,

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About