Re: [pcre-dev] Max lookbehind calculation

Top Page
Delete this message
Author: ND
Date:  
To: Pcre-dev
Subject: Re: [pcre-dev] Max lookbehind calculation
On 2019-06-22 16:37, ph10 wrote:

> nesting lookbehinds in the way you have done is unusual.


It may be less unusial if we use a simple assertions:

PCRE2 version 10.33 2019-04-16
/(?<=\ba)b.*/info
Capture group count = 0
Max lookbehind = 1
First code unit = 'b'
Subject length lower bound = 1
xyz-abc\=ph
Partial match: abc
                <



I agree that max lookbehind value corresponds to docs.
But this is not an end in itself. We keep in mind that max lookbehind
value calculation intended for multisegment matching.

In example we can see that after partial match two additional symbols of
previous match need to be keeped "-a". But PCRE reported only one "a".

This means that calculation of max lookbehind must be corrected to provide
the ability to do proper multisegment matching.