Re: [pcre-dev] Detecting starting code units

Pàgina inicial
Delete this message
Autor: ND
Data:  
A: Pcre-dev
Assumpte: Re: [pcre-dev] Detecting starting code units
On 2019-07-27 08:46, ph10 wrote:

>For an anchored pattern, the "must be present" code unit value is set
> only if it follows a variable length item in the pattern.
>This is a judgement that it will probably be faster in most cases and it
> will avoid the really bad case: suppose, instead of "abx" you have
> abxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...very long string without "c"
> It can take a lot of time to search a long string (and in fact, for that
> reason, there is a limit to how much is searched, even when there is a
> value to search for). Much quicker to fail the match after just checking
> the first three characters.
>


It's reasonable.
Thanks.