develooper Front page | perl.perl5.porters | Postings from August 2008

Re: Wrong RE match in 5.10.0

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
August 24, 2008 02:57
Subject:
Re: Wrong RE match in 5.10.0
Message ID:
20080824095739.GF3405@iabyn.com
On Sun, Aug 24, 2008 at 11:29:51AM +0200, Gisle Aas wrote:
> On Aug 23, 2008, at 16:18, Abigail wrote:
>
>>>
>>> Reducded the example a bit more to make it more obvious (I was  
>>> initially
>>> confused by what you were saying):
>>>
>>> #!perl
>>>
>>> $str = "x" x (1024 * 100);
>>> if ($str =~ /^(.)(\1*)\z/) {
>>>   print "$1 ", length($2), "\n";
>>> }
>>> else {
>>>   print "no match\n";
>>> }
>>> __END__
>>>
>>> perl-blead prints 'no match' which is unexpected since logically
>>> speaking the regex matches the input.
>>
>>
>> But if you turn on warnings, it's less unexpected, as Perl does warn:
>>
>>     Complex regular subexpression recursion limit (32766) exceeded
>
> What I'm saying is that it would be preferable if this was a die instead 
> of a warn.

What would be even better would be to remove the 32K limit.

-- 
Any [programming] language that doesn't occasionally surprise the
novice will pay for it by continually surprising the expert.
   -- Larry Wall

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