Re: [pcre-dev] Quantifying backtracking verbs

Pàgina inicial
Delete this message
Autor: ND
Data:  
A: Pcre-dev
Assumpte: Re: [pcre-dev] Quantifying backtracking verbs
On 2019-06-05 16:53, ph10 wrote:

>Perl gets it wrong:
>/(a(?:(*ACCEPT))??bc)/
> axy
> No match
>/a(*ACCEPT)??bc/
> axy
> No match
>


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. It seems correction needed to act
with such pattern accurately (as with "(a(*ACCEPT)bc)")


>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.
>


It's fine for me.