123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540 |
- # These are:
- #
- # (1) Tests of the match-limiting features. The results are different for
- # interpretive or JIT matching, so this test should not be run with JIT. The
- # same tests are run using JIT in test 17.
- # (2) Other tests that must not be run with JIT.
- # These tests are first so that they don't inherit a large enough heap frame
- # vector from a previous test.
- /(*LIMIT_HEAP=21)\[(a)]{60}/expand
- \[a]{60}
- Failed: error -63: heap limit exceeded
- "(*LIMIT_HEAP=21)()((?))()()()()()()()()()()()()()()()()()()()()()()()(())()()()()()()()()()()()()()()()()()()()()()(())()()()()()()()()()()()()()"
- xx
- Failed: error -63: heap limit exceeded
- # -----------------------------------------------------------------------
- /(a+)*zz/I
- Capture group count = 1
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits_noheap
- Minimum match limit = 7
- Minimum depth limit = 7
- 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
- 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- aaaaaaaaaaaaaz\=find_limits_noheap
- Minimum match limit = 20481
- Minimum depth limit = 30
- No match
- !((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
- Capture group count = 1
- May match empty string
- Subject length lower bound = 0
- /* this is a C style comment */\=find_limits_noheap
- Minimum match limit = 64
- Minimum depth limit = 7
- 0: /* this is a C style comment */
- 1: /* this is a C style comment */
- /^(?>a)++/
- aa\=find_limits_noheap
- Minimum match limit = 5
- Minimum depth limit = 3
- 0: aa
- aaaaaaaaa\=find_limits_noheap
- Minimum match limit = 12
- Minimum depth limit = 3
- 0: aaaaaaaaa
- /(a)(?1)++/
- aa\=find_limits_noheap
- Minimum match limit = 7
- Minimum depth limit = 5
- 0: aa
- 1: a
- aaaaaaaaa\=find_limits_noheap
- Minimum match limit = 21
- Minimum depth limit = 5
- 0: aaaaaaaaa
- 1: a
- /a(?:.)*?a/ims
- abbbbbbbbbbbbbbbbbbbbba\=find_limits_noheap
- Minimum match limit = 24
- Minimum depth limit = 3
- 0: abbbbbbbbbbbbbbbbbbbbba
- /a(?:.(*THEN))*?a/ims
- abbbbbbbbbbbbbbbbbbbbba\=find_limits_noheap
- Minimum match limit = 66
- Minimum depth limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
- /a(?:.(*THEN:ABC))*?a/ims
- abbbbbbbbbbbbbbbbbbbbba\=find_limits_noheap
- Minimum match limit = 66
- Minimum depth limit = 45
- 0: abbbbbbbbbbbbbbbbbbbbba
- /^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
- aabbccddee\=find_limits_noheap
- Minimum match limit = 7
- Minimum depth limit = 7
- 0: aabbccddee
- /^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
- aabbccddee\=find_limits_noheap
- Minimum match limit = 12
- Minimum depth limit = 12
- 0: aabbccddee
- 1: aa
- 2: bb
- 3: cc
- 4: dd
- 5: ee
- /^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
- aabbccddee\=find_limits_noheap
- Minimum match limit = 10
- Minimum depth limit = 10
- 0: aabbccddee
- 1: aa
- 2: cc
- 3: ee
- /(*LIMIT_MATCH=12bc)abc/
- Failed: error 160 at offset 17: (*VERB) not recognized or malformed
- /(*LIMIT_MATCH=4294967290)abc/
- Failed: error 160 at offset 24: (*VERB) not recognized or malformed
- /(*LIMIT_DEPTH=4294967280)abc/I
- Capture group count = 0
- Depth limit = 4294967280
- First code unit = 'a'
- Last code unit = 'c'
- Subject length lower bound = 3
- /(a+)*zz/
- \= Expect no match
- aaaaaaaaaaaaaz
- No match
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=match_limit=3000
- Failed: error -47: match limit exceeded
- /(a+)*zz/
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=depth_limit=10
- Failed: error -53: matching depth limit exceeded
- /(*LIMIT_MATCH=3000)(a+)*zz/I
- Capture group count = 1
- Match limit = 3000
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect limit exceeded
- aaaaaaaaaaaaaz
- Failed: error -47: match limit exceeded
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=match_limit=60000
- Failed: error -47: match limit exceeded
- /(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
- Capture group count = 1
- Match limit = 3000
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect limit exceeded
- aaaaaaaaaaaaaz
- Failed: error -47: match limit exceeded
- /(*LIMIT_MATCH=60000)(a+)*zz/I
- Capture group count = 1
- Match limit = 60000
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect no match
- aaaaaaaaaaaaaz
- No match
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=match_limit=3000
- Failed: error -47: match limit exceeded
- /(*LIMIT_DEPTH=10)(a+)*zz/I
- Capture group count = 1
- Depth limit = 10
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect limit exceeded
- aaaaaaaaaaaaaz
- Failed: error -53: matching depth limit exceeded
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=depth_limit=1000
- Failed: error -53: matching depth limit exceeded
- /(*LIMIT_DEPTH=10)(*LIMIT_DEPTH=1000)(a+)*zz/I
- Capture group count = 1
- Depth limit = 1000
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect no match
- aaaaaaaaaaaaaz
- No match
- /(*LIMIT_DEPTH=1000)(a+)*zz/I
- Capture group count = 1
- Depth limit = 1000
- Starting code units: a z
- Last code unit = 'z'
- Subject length lower bound = 2
- \= Expect no match
- aaaaaaaaaaaaaz
- No match
- \= Expect limit exceeded
- aaaaaaaaaaaaaz\=depth_limit=10
- Failed: error -53: matching depth limit exceeded
- # These three have infinitely nested recursions.
- /((?2))((?1))/
- abc
- Failed: error -52: nested recursion at the same subject position
- /((?(R2)a+|(?1)b))()/
- aaaabcde
- Failed: error -52: nested recursion at the same subject position
- /(?(R)a*(?1)|((?R))b)/
- aaaabcde
- Failed: error -52: nested recursion at the same subject position
- # The allusedtext modifier does not work with JIT, which does not maintain
- # the leftchar/rightchar data.
- /abc(?=xyz)/allusedtext
- abcxyzpqr
- 0: abcxyz
- >>>
- abcxyzpqr\=aftertext
- 0: abcxyz
- >>>
- 0+ xyzpqr
- /(?<=pqr)abc(?=xyz)/allusedtext
- xyzpqrabcxyzpqr
- 0: pqrabcxyz
- <<< >>>
- xyzpqrabcxyzpqr\=aftertext
- 0: pqrabcxyz
- <<< >>>
- 0+ xyzpqr
- /a\b/
- a.\=allusedtext
- 0: a.
- >
- a\=allusedtext
- 0: a
- /abc\Kxyz/
- abcxyz\=allusedtext
- 0: abcxyz
- <<<
- /abc(?=xyz(*ACCEPT))/
- abcxyz\=allusedtext
- 0: abcxyz
- >>>
- /abc(?=abcde)(?=ab)/allusedtext
- abcabcdefg
- 0: abcabcde
- >>>>>
- #subject allusedtext
- /(?<=abc)123/
- xyzabc123pqr
- 0: abc123
- <<<
- xyzabc12\=ps
- Partial match: abc12
- <<<
- xyzabc12\=ph
- Partial match: abc12
- <<<
- /\babc\b/
- +++abc+++
- 0: +abc+
- < >
- +++ab\=ps
- Partial match: +ab
- <
- +++ab\=ph
- Partial match: +ab
- <
- /(?<=abc)def/
- abc\=ph
- Partial match: abc
- <<<
- /(?<=123)(*MARK:xx)abc/mark
- xxxx123a\=ph
- Partial match, mark=xx: 123a
- <<<
- xxxx123a\=ps
- Partial match, mark=xx: 123a
- <<<
- /(?<=(?<=a)b)c.*/I
- Capture group count = 0
- Max lookbehind = 1
- First code unit = 'c'
- Subject length lower bound = 1
- abc\=ph
- Partial match: abc
- <<
- \= Expect no match
- xbc\=ph
- No match
- /(?<=ab)c.*/I
- Capture group count = 0
- Max lookbehind = 2
- First code unit = 'c'
- Subject length lower bound = 1
- abc\=ph
- Partial match: abc
- <<
- \= Expect no match
- xbc\=ph
- No match
- /abc(?<=bc)def/
- xxxabcd\=ph
- Partial match: abcd
- /(?<=ab)cdef/
- xxabcd\=ph
- Partial match: abcd
- <<
- /(?<=(?<=(?<=a)b)c)./I
- Capture group count = 0
- Max lookbehind = 1
- Subject length lower bound = 1
- 123abcXYZ
- 0: abcX
- <<<
- /(?<=ab(cd(?<=...)))./I
- Capture group count = 1
- Max lookbehind = 4
- Subject length lower bound = 1
- abcdX
- 0: abcdX
- <<<<
- 1: cd
- /(?<=ab((?<=...)cd))./I
- Capture group count = 1
- Max lookbehind = 4
- Subject length lower bound = 1
- ZabcdX
- 0: ZabcdX
- <<<<<
- 1: cd
- /(?<=((?<=(?<=ab).))(?1)(?1))./I
- Capture group count = 1
- Max lookbehind = 2
- Subject length lower bound = 1
- abxZ
- 0: abxZ
- <<<
- 1:
- #subject
- # -------------------------------------------------------------------
- # These tests provoke recursion loops, which give a different error message
- # when JIT is used.
- /(?R)/I
- Capture group count = 0
- May match empty string
- Subject length lower bound = 0
- abcd
- Failed: error -52: nested recursion at the same subject position
- /(a|(?R))/I
- Capture group count = 1
- May match empty string
- Subject length lower bound = 0
- abcd
- 0: a
- 1: a
- defg
- Failed: error -52: nested recursion at the same subject position
- /(ab|(bc|(de|(?R))))/I
- Capture group count = 3
- May match empty string
- Subject length lower bound = 0
- abcd
- 0: ab
- 1: ab
- fghi
- Failed: error -52: nested recursion at the same subject position
- /(ab|(bc|(de|(?1))))/I
- Capture group count = 3
- May match empty string
- Subject length lower bound = 0
- abcd
- 0: ab
- 1: ab
- fghi
- Failed: error -52: nested recursion at the same subject position
- /x(ab|(bc|(de|(?1)x)x)x)/I
- Capture group count = 3
- First code unit = 'x'
- Subject length lower bound = 3
- xab123
- 0: xab
- 1: ab
- xfghi
- Failed: error -52: nested recursion at the same subject position
- /(?!\w)(?R)/
- abcd
- Failed: error -52: nested recursion at the same subject position
- =abc
- Failed: error -52: nested recursion at the same subject position
- /(?=\w)(?R)/
- =abc
- Failed: error -52: nested recursion at the same subject position
- abcd
- Failed: error -52: nested recursion at the same subject position
- /(?<!\w)(?R)/
- abcd
- Failed: error -52: nested recursion at the same subject position
- /(?<=\w)(?R)/
- abcd
- Failed: error -52: nested recursion at the same subject position
- /(a+|(?R)b)/
- aaa
- 0: aaa
- 1: aaa
- bbb
- Failed: error -52: nested recursion at the same subject position
- /[^\xff]((?1))/BI
- ------------------------------------------------------------------
- Bra
- [^\x{ff}]
- CBra 1
- Recurse
- Ket
- Ket
- End
- ------------------------------------------------------------------
- Capture group count = 1
- Subject length lower bound = 1
- abcd
- Failed: error -52: nested recursion at the same subject position
- # These tests don't behave the same with JIT
- /\w+(?C1)/BI,no_auto_possess
- ------------------------------------------------------------------
- Bra
- \w+
- Callout 1 8 0
- Ket
- End
- ------------------------------------------------------------------
- Capture group count = 0
- Options: no_auto_possess
- Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
- Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
- Subject length lower bound = 1
- abc\=callout_fail=1
- --->abc
- 1 ^ ^ End of pattern
- 1 ^ ^ End of pattern
- 1 ^^ End of pattern
- 1 ^ ^ End of pattern
- 1 ^^ End of pattern
- 1 ^^ End of pattern
- No match
- /(*NO_AUTO_POSSESS)\w+(?C1)/BI
- ------------------------------------------------------------------
- Bra
- \w+
- Callout 1 26 0
- Ket
- End
- ------------------------------------------------------------------
- Capture group count = 0
- Compile options: <none>
- Overall options: no_auto_possess
- Starting code units: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
- Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
- Subject length lower bound = 1
- abc\=callout_fail=1
- --->abc
- 1 ^ ^ End of pattern
- 1 ^ ^ End of pattern
- 1 ^^ End of pattern
- 1 ^ ^ End of pattern
- 1 ^^ End of pattern
- 1 ^^ End of pattern
- No match
- # This test breaks the JIT stack limit
- /(|]+){2,2452}/
- (|]+){2,2452}
- 0:
- 1:
- /b(?<!ax)(?!cx)/allusedtext
- abc
- 0: abc
- < >
- abcz
- 0: abcz
- < >>
- # This test triggers the recursion limit in the interpreter, but completes in
- # JIT. It's in testinput2 with disable_recurse_loop_check to get it to work
- # in the interpreter.
- /(a(?1)z||(?1)++)$/
- abcd
- Failed: error -52: nested recursion at the same subject position
- # End of testinput15
|