Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upRegular expression with lookahead does not match, while it should. #13954
Comments
This comment has been minimized.
This comment has been minimized.
From dietmar.schindler@manroland-web.comThis is a bug report for perl from dietmar.schindler@manroland-web.com, I observed the following bug in Perl versions 5.10.1, 5.18.2 and 5.20.0, while Flags: Site configuration information for perl 5.20.0: Configured by strawberry-perl at Fri May 30 08:28:40 2014. Summary of my perl5 (revision 5 version 20 subversion 0) configuration: Platform: @INC for perl 5.20.0: Environment for perl 5.20.0: Confidentiality note: ! Please consider your environmental responsibility before printing this eMail ! |
This comment has been minimized.
This comment has been minimized.
From @jkeenanOn Tue Jun 24 00:45:27 2014, dietmar.schindler@manroland-web.com wrote:
I don't believe this is a bug in Perl 5. According to 'perldoc perlre' in blead: "(?=pattern)" is used as "A zero-width positive look-ahead assertion." If we are to look ahead, we have to have something in the pattern *from which we are looking ahead*. I don't see anything like that in your pattern. Did you perhaps want a positive look-behind pattern "(?<=pattern)"? Thank you very much. |
This comment has been minimized.
This comment has been minimized.
The RT System itself - Status changed from 'new' to 'open' |
This comment has been minimized.
This comment has been minimized.
From Eirik-Berg.Hanssen@allverden.noOn Tue, Jun 24, 2014 at 10:52 PM, James E Keenan via RT <
Huh? It's supposed to be looking ahead from the starting position, which $ perl -wE '"foo bar" =~ /(?=[bo])(?{ say pos })(?!)/' Observe also: $ perl -E 'say " P" =~ /(?=P)P/' $ Why shouldn't .* match the empty string? I'm pretty sure this is a Eirik |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonOn 06/24/2014 03:39 PM, Eirik Berg Hanssen wrote:
The commit that changed the behavior from the original to the current Re: [PATCH] Better version of the Aho-Corasick patch and lots of (with tweaks) |
This comment has been minimized.
This comment has been minimized.
From @demerphqOn 25 June 2014 00:28, Karl Williamson <public@khwilliamson.com> wrote:
That surprises me given this: $ ./perl -Ilib -Mre=debug -le'" P" =~ /(?=.*P)P/' Why did it decide it is anchored? It shouldn't have decided that. If you bisected maybe this is a false positive. Yves -- |
This comment has been minimized.
This comment has been minimized.
From @demerphqOn 25 June 2014 08:36, demerphq <demerphq@gmail.com> wrote:
Anyway, it is clearly the optimiser going wrong, as you can see below. If I find some time to debug further I will let you know what I find. Yves $ ./perl -Ilib -Mre=Debug,ALL -le'" P" =~ /(?=.*P)P/'
-- |
This comment has been minimized.
This comment has been minimized.
From @demerphqOn 25 June 2014 08:43, demerphq <demerphq@gmail.com> wrote:
I pushed a fix. Since I am "retired" right now I did not push tests. Yves -- |
This comment has been minimized.
This comment has been minimized.
From @wolfsageOn Wed, Jun 25, 2014 at 3:33 AM, demerphq <demerphq@gmail.com> wrote:
Thanks. I've added a small test case in 06ab3c1. More would be good though. -- Matthew Horsfall (alh) |
This comment has been minimized.
This comment has been minimized.
From @khwilliamsonFixed by c445c5b |
This comment has been minimized.
This comment has been minimized.
@khwilliamson - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#122171 (status was 'resolved')
Searchable as RT122171$