Re: [pcre-dev] Calculate minimum subject length

Page principale
Supprimer ce message
Auteur: ph10
Date:  
À: pcre-dev
CC: ND
Sujet: Re: [pcre-dev] Calculate minimum subject length
On Mon, 26 Aug 2019, I wrote:

> On Sun, 18 Aug 2019, ND via Pcre-dev wrote:
>
> > May be when meet (*ACCEPT) find_minlength must simply drop further
> > calculations for current branch. So the current value of "branchlength" will
> > be immediately considered as a minimum length of whole branch.
>
> That was not easily possible in the past, but recently there was some
> work done which might make it simple to do now. I will look further at
> this.


I've realized why this won't work. The problem is that ACCEPT may occur
in branches that are not scanned. It needs far too much analysis.
Consider:

/A(B(*ACCEPT)C)?DEF/

When computing the minimum length, the code will skip the group
altogether, because it has a minimum repeat of 0. It will end up with a
minimum length of 4, which of course is wrong.

Philip

--
Philip Hazel