Re: [pcre-dev] Optimizations when execution order is importa…

Kezdőlap
Üzenet törlése
Szerző: mavvma
Dátum:  
Címzett: pcre-dev
Tárgy: Re: [pcre-dev] Optimizations when execution order is important
On Mon, 15 Dec 2008 14:21:51 +0300, Philip Hazel <ph10@???> wrote:

> On Sat, 13 Dec 2008, mavvma@??? wrote:
>
>> PCRE Callout documentation says: "You should be aware that, because of
>> optimizations in the way PCRE matches patterns, callouts sometimes do
>> not happen."
>>
>> In some cases if user inserts callout, he surely want to deal some
>> action at this point. But due to such optimizations (they are
>> PCRE-inside and may be unknown for user) expected order may be
>> affected.
>
> It is not the order that is affected. There are shortcuts to failure.
> For example, if your pattern is /anything....A/ PCRE knows that there
> must be an occurrence of the letter "A" somewhere in the subject string.
> Before it even starts matching, it does a quick check. If it does not
> find "A", the match fails before it even starts.


IMHO, in certain cases it's not quite right. For example, /...(*ACCEPT)...A/ at user's point of view may be accessed without letter "A" occurrence. Are "disordering" optimizations invoked in this case?