Re: [pcre-dev] Quantifying backtracking verbs

Kezdőlap
Üzenet törlése
Szerző: ph10
Dátum:  
Címzett: ND
CC: Pcre-dev
Tárgy: Re: [pcre-dev] Quantifying backtracking verbs
On Wed, 5 Jun 2019, ND via Pcre-dev wrote:

> It seems a bug of Perl start optimizer. It say:
> "Did not find floating substr "bc"...
> Match rejected by optimizer"
>
> Please look at PCRE start optimizer.


PCRE2 does not record "c" as necessary after (*ACCEPT). So it does not
have this bug. (It only records a single code unit.)

> >The simplest fix for PCRE2 is to change (*ACCEPT)<quantifier> into
> >(?:(*ACCEPT))<quantifier> at compile time. This avoids any
> >implementation requirement at match time and in the JIT.


I have done this, and committed the result. However, it seems to me that
/a(*ACCEPT)??bc/ is the same as a(?:bc|) though if a, b, and c are
complex it may be easier to read.

Philip

--
Philip Hazel