Ignore {1} quantifiers.
This commit is contained in:
parent
5cd731f314
commit
54f59d3c05
|
@ -37,6 +37,9 @@ overflow. This bug was discovered by Karl Skomski with the LLVM fuzzer.
|
|||
9. The handling of callouts during the pre-pass for named group identification
|
||||
has been tightened up.
|
||||
|
||||
10. The quantifier {1} can be ignored, whether greedy, non-greedy, or
|
||||
possessive. This is a very minor optimization.
|
||||
|
||||
|
||||
Version 10.20 30-June-2015
|
||||
--------------------------
|
||||
|
|
|
@ -4719,6 +4719,10 @@ for (;; ptr++)
|
|||
}
|
||||
else repeat_type = greedy_default;
|
||||
|
||||
/* If the repeat is {1} we can ignore it. */
|
||||
|
||||
if (repeat_max == 1 && repeat_min == 1) goto END_REPEAT;
|
||||
|
||||
/* If previous was a recursion call, wrap it in atomic brackets so that
|
||||
previous becomes the atomic group. All recursions were so wrapped in the
|
||||
past, but it no longer happens for non-repeated recursions. In fact, the
|
||||
|
|
|
@ -1259,7 +1259,11 @@
|
|||
|
||||
/(a(b(?2)c)){0,2}/IB
|
||||
|
||||
/[ab]{1}+/IB
|
||||
/[ab]{1}+/B
|
||||
|
||||
/()(?1){1}/B
|
||||
|
||||
/()(?1)/B
|
||||
|
||||
/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
|
||||
Baby Bjorn Active Carrier - With free SHIPPING!!
|
||||
|
|
|
@ -4533,16 +4533,33 @@ Capturing subpattern count = 2
|
|||
May match empty string
|
||||
Subject length lower bound = 0
|
||||
|
||||
/[ab]{1}+/IB
|
||||
/[ab]{1}+/B
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
[ab]{1,1}+
|
||||
[ab]
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/()(?1){1}/B
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
CBra 1
|
||||
Ket
|
||||
Recurse
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
|
||||
/()(?1)/B
|
||||
------------------------------------------------------------------
|
||||
Bra
|
||||
CBra 1
|
||||
Ket
|
||||
Recurse
|
||||
Ket
|
||||
End
|
||||
------------------------------------------------------------------
|
||||
Capturing subpattern count = 0
|
||||
Starting code units: a b
|
||||
Subject length lower bound = 1
|
||||
|
||||
/((w\/|-|with)*(free|immediate)*.*?shipping\s*[!.-]*)/Ii
|
||||
Capturing subpattern count = 3
|
||||
|
|
Loading…
Reference in New Issue