On Tue Apr 07 09:46:45 2015, ph10@hermes.cam.ac.uk wrote: > This is a bug report for perl from ph10@hermes.cam.ac.uk, > generated with the help of perlbug 1.40 running under perl 5.20.2. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > The command > > perl -e 'while("aaaa" =~ /(?<=\Ka)/g){};' > > puts Perl into an infinite loop. Without the \K in the assertion, it > finishes instantly. A little diagnostic: ##### $ cat 124256-regex.pl # perl use strict; use warnings; use 5.10.1; while ("aaaa" =~ /(?<=a)/g) { say "Yes: <", join('|' => $`, $&, $'), ">"; } say ''; # Below: Infinite loop while ("aaaa" =~ /(?<=\Ka)/g) { say "Yes: <", join('|' => $`, $&, $'), ">"; } ##### The top part produces: ##### Yes: <a||aaa> Yes: <aa||aa> Yes: <aaa||a> Yes: <aaaa||> ##### The bottom part loops forever, producing: ##### Yes: <|a|aaa> ##### > I think this is a similar bug to the one I have just > fixed in PCRE. > Can you provide a link to that fix? Thank you very much. -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: new https://rt.perl.org/Ticket/Display.html?id=124256Thread Previous