develooper Front page | perl.perl5.porters | Postings from May 2012

[perl #112604] perlre man page contains suspect example of recursion

From:
Father Chrysostomos via RT
Date:
May 23, 2012 18:21
Subject:
[perl #112604] perlre man page contains suspect example of recursion
Message ID:
rt-3.6.HEAD-7788-1337822491-1767.112604-15-0@perl.org
On Tue Apr 24 14:45:54 2012, rjk@tamias.net wrote:
> On Tue, Apr 24, 2012 at 12:56:12PM -0700, Jim Avera wrote:
> 
> > The perlre man page contains the following suspect example in the
> > section on recursive group references:
> > 
> >     my $parens = qr/(\((?:[^()]++|(?-1))*+\))/;
> >     if (/foo $parens \s+ + \s+ bar $parens/x) {
> >       # do something here...
> >     }
> > 
> > This seems incorrect because the \s++ eats all white space without
> > backtracking, preventing the following \s+ from matching.
> > Thus the pattern always fails for any input.
> > 
> > OTOH, I may be missing something.  I did try the code and couldn't
> > find any input which the example code matched.
> 
> It should be \s+ \+ \s+
> 
> Ronald
> 

Thank you.  Applied as c77257ed0e74.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=112604



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