develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #18268] (a|b)* cant match a string larger than 2**15-1 chars long.

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
February 27, 2015 20:08
Subject:
[perl #18268] (a|b)* cant match a string larger than 2**15-1 chars long.
Message ID:
rt-4.0.18-12779-1425067706-372.18268-15-0@perl.org
On Sat Jul 27 00:03:28 2013, sprout wrote:
> On Sun Oct 14 16:06:33 2012, hv wrote:
> > It is fixable, and I believe eventually it'll have to be fixed - as
> > computational power and size of typical strings increases, it is a
> > constraint that will seem increasingly restrictive.
> > 
> > I just don't know (quite) how, or when.
> 
> Hopefully soon.
> 
> I’m trying to write tests for perl’s anchored string optimisation with
> large strings.  But I’m having to write things like this:
> 
> (?:(?:.{32766}){32766}){2}(?:.{32766}){8}.{8}
> 
> This is a bit annoying. :-)
> 

Has anyone been able to make any progress on this issue?

In 5.20.1:

#####
$ perl -wle '$_="x" . ("a" x (2 ** 15 - 1)) . "y"; print (/x(bc|a)*y/ ? "yes" : "no");'
Complex regular subexpression recursion limit (32766) exceeded at -e line 1.
yes

$ perl -wle '$_="x" . ("a" x (2 ** 15    )) . "y"; print (/x(bc|a)*y/ ? "yes" : "no");'
Complex regular subexpression recursion limit (32766) exceeded at -e line 1.
#####
-- 
James E Keenan (jkeenan@cpan.org)

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

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