[pcre-dev] Quantifying backtracking verbs

Αρχική Σελίδα
Delete this message
Συντάκτης: ND
Ημερομηνία:  
Προς: Pcre-dev
Αντικείμενο: [pcre-dev] Quantifying backtracking verbs

Good day!

Here is pcre2test listing:


PCRE2 version 10.33 2019-04-16
/A(?:(*ACCEPT))?B/
A
No match

/A(?:(*ACCEPT))?B/no_start_optimize
A
0: A

/A(*ACCEPT)?B/
Failed: error 109 at offset 10: quantifier does not follow a repeatable
item
A


I have a two questions with it:
1. Start optimizer brakes a result to "no match" from "match". Is there
documented (I remember only example with (*COMMIT) where optimizer can
make "match" from "no match")? May be there is a way to correct this PCRE
optimization to not break a result.
2. If "(?:(*ACCEPT))?" syntax is allowed, then why a more ergonomic
"(*ACCEPT)?" is disabled?


Thanks in advance