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

Re: Wrong RE match in 5.10.0

Thread Previous | Thread Next
From:
David Nicol
Date:
August 25, 2008 08:32
Subject:
Re: Wrong RE match in 5.10.0
Message ID:
934f64a20808250832x1b477076m96956cd9751228f5@mail.gmail.com
>>>> $str = "x" x (1024 * 100);
>>>> if ($str =~ /^(.)(\1*)\z/) {
>>>>   print "$1 ", length($2), "\n";
>>>> }
>>>> else {
>>>>   print "no match\n";
>>>> }
>>>> __END__

but why is this recursing at all?  It doesn't need to backtrack.
Could the * be made to simply loop instead of recursing?

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