Re: [pcre-dev] Partial match at end of subject

Top Page
Delete this message
Author: ND
Date:  
To: Pcre-dev
Subject: Re: [pcre-dev] Partial match at end of subject
On 2019-07-22 17:32, ND wrote:

>Now it can be useful to try putting into words, what exactly in applying
> to multisegment matching means "local no match" and what means "partial
> match".
>



Doc's says:
A partial match occurs during a call to pcre2_match() when the end of the
subject string is reached successfully, but matching cannot continue
because more characters are needed, and in addition, either at least one
character in the subject has been inspected or the pattern contains a
lookbehind, or (when PCRE2_PARTIAL_HARD is set) the pattern could match an
empty string.

So docs says what exactly we decide to name a "partial match". But WHY we
want to name "partial match" this strange complex thing? What practical or
logical basis is under that?


/x/
ab\=ph
No match

/(?=x)/
ab\=ph
Partial match:

/(?<=x)?y/
ab\=ph
Partial match:


For example, WHY we want to define first as nomatch while second and third
as partial?
It's unobvious thing.