Autor: ph10 Data: A: ND CC: Pcre-dev Assumpte: Re: [pcre-dev] Partial match at end of subject
On Sun, 21 Jul 2019, ND via Pcre-dev wrote:
> New algorithm still have another parts of discussed oversight. For example it
> returns full match instead of partial in following cases:
>
> /(?![ab]).*/
> ab\=ph
> 0:
>
> /c*+/
> ab\=ph,offset=2
> 0:
The answer to that may lie in thinking about zero repeat items.
> Alternative suggestion don't have this troubles. It simplify calculations that
> main application must do after matching of every segment. It also have more
> common and simple (for user understanding) algorithm and can have simpler
> docs.
But it is a big incompatible change and nobody else has brought up any
of these points in the last 10 years.
> >ND quoted /(*COMMIT)(*F)/ as a
> >simple example. Is (*COMMIT) the only way this might happen?
>
> Not only. It may also happen with anchored patterns.
The user can find out if a pattern is anchored. If it is, there is no
point continuing with another segment after no match on the first
segment.