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

Re: regexes: more end-of-string optimizations

Thread Previous
From:
Jeff 'japhy/Marillion' Pinyan
Date:
July 29, 2001 07:42
Subject:
Re: regexes: more end-of-string optimizations
Message ID:
Pine.GSO.4.21.0107291042000.28213-100000@crusoe.crusoe.net
On Jul 29, Ton Hospel said:

>In article <Pine.GSO.4.21.0107282304050.28213-100000@crusoe.crusoe.net>,
>	Jeff 'japhy/Marillion' Pinyan <jeffp@crusoe.net> writes:
>> This leads me to my optimization proposal:  unless (??{ ... }) interferes,
>> any regex with a $ or \Z or \z end-of-string anchor should be able to fail
>> immediately upon inspection of the end of the string.
>
>don't forget that the m modifier also interferes for $

I'm well aware of that.  And that doesn't lend itself to much
optimization, since you have to tunnel through the string first to find
the newlines.  We already know where the end of the string is.

Maybe it'll be ok.

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


Thread Previous


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