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

Re: [perl #119073] Misbehaving regex

Thread Previous | Thread Next
From:
demerphq
Date:
July 29, 2013 17:19
Subject:
Re: [perl #119073] Misbehaving regex
Message ID:
CANgJU+XK3Oaw7DeP+JNVWAQ8c-ArfrzXV2ePdjQhstJqoa2u2w@mail.gmail.com
On 29 July 2013 18:26, Philip Hazel <perlbug-followup@perl.org> wrote:
> # New Ticket Created by  Philip Hazel
> # Please include the string:  [perl #119073]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=119073 >
>
>
> 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 '"b" =~ /(?1)(?:(b)){0}/; print ">$&<\n";'
>><
>
> In previous versions of Perl, this would print >b< that is, the regex matched
> "b", which is what I think it should.

I think this is fallout from the {0} => NOTHING optimization.  It
appears this optimization cannot be applied when the patterns are
recursive.

Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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