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

Re: [perl #119071] Misdiagnosed regex infinite recursion

Thread Previous | Thread Next
From:
demerphq
Date:
July 29, 2013 17:20
Subject:
Re: [perl #119071] Misdiagnosed regex infinite recursion
Message ID:
CANgJU+VeOWSthBexCWcecZ4YLC011etgw9eStLo5xLOFv+uipg@mail.gmail.com
On 29 July 2013 18:17, Philip Hazel <perlbug-followup@perl.org> wrote:
> # New Ticket Created by  Philip Hazel
> # Please include the string:  [perl #119071]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119071 >
>
>
> This is a bug report for perl from ph10@cam.ac.uk,
> generated with the help of perlbug 1.39 running under perl 5.18.0.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> $ perl -e 'x =~ /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/'
> Infinite recursion in regex at -e line 1.
>
> As far as I can see, there is no infinite recursion here. Capturing group
> number 1 is (a(*SKIP)b) and that does not do any recursing, so calling
> it via (?1) is just a single recursion.

This looks to me like another example of {0} => NOTHING optimization
not playing nicely with recursive patterns.

Yves

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About