2015-08-18 12:34:05 +02:00
|
|
|
# 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.
|
2014-08-08 20:18:18 +02:00
|
|
|
|
2015-08-18 12:34:05 +02:00
|
|
|
# (2) Other tests that must not be run with JIT.
|
|
|
|
|
|
|
|
/(a+)*zz/I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 7
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 7
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
|
|
|
|
1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
|
|
aaaaaaaaaaaaaz\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 20481
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 30
|
2015-08-18 12:34:05 +02:00
|
|
|
No match
|
|
|
|
|
|
|
|
!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
May match empty string
|
|
|
|
Subject length lower bound = 0
|
|
|
|
/* this is a C style comment */\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 64
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 7
|
2015-08-18 12:34:05 +02:00
|
|
|
0: /* this is a C style comment */
|
|
|
|
1: /* this is a C style comment */
|
|
|
|
|
|
|
|
/^(?>a)++/
|
|
|
|
aa\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
Minimum match limit = 5
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 3
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aa
|
|
|
|
aaaaaaaaa\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
Minimum match limit = 12
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 3
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aaaaaaaaa
|
|
|
|
|
|
|
|
/(a)(?1)++/
|
|
|
|
aa\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
Minimum match limit = 7
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 5
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aa
|
|
|
|
1: a
|
|
|
|
aaaaaaaaa\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
Minimum match limit = 21
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 5
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aaaaaaaaa
|
|
|
|
1: a
|
|
|
|
|
|
|
|
/a(?:.)*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 24
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 3
|
2015-08-18 12:34:05 +02:00
|
|
|
0: abbbbbbbbbbbbbbbbbbbbba
|
|
|
|
|
|
|
|
/a(?:.(*THEN))*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 66
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 45
|
2015-08-18 12:34:05 +02:00
|
|
|
0: abbbbbbbbbbbbbbbbbbbbba
|
|
|
|
|
|
|
|
/a(?:.(*THEN:ABC))*?a/ims
|
|
|
|
abbbbbbbbbbbbbbbbbbbbba\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 66
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 45
|
2015-08-18 12:34:05 +02:00
|
|
|
0: abbbbbbbbbbbbbbbbbbbbba
|
|
|
|
|
|
|
|
/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
|
|
|
|
aabbccddee\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
Minimum match limit = 7
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 7
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aabbccddee
|
|
|
|
|
|
|
|
/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
|
|
|
|
aabbccddee\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 12
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 12
|
2015-08-18 12:34:05 +02:00
|
|
|
0: aabbccddee
|
|
|
|
1: aa
|
|
|
|
2: bb
|
|
|
|
3: cc
|
|
|
|
4: dd
|
|
|
|
5: ee
|
|
|
|
|
|
|
|
/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
|
|
|
|
aabbccddee\=find_limits
|
2017-04-11 13:47:25 +02:00
|
|
|
Minimum heap limit = 0
|
2017-03-09 17:23:28 +01:00
|
|
|
Minimum match limit = 10
|
2017-03-12 14:47:01 +01:00
|
|
|
Minimum depth limit = 10
|
2015-08-18 12:34:05 +02:00
|
|
|
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
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
/(*LIMIT_DEPTH=4294967280)abc/I
|
2014-08-08 20:18:18 +02:00
|
|
|
Capturing subpattern count = 0
|
2017-03-12 14:47:01 +01:00
|
|
|
Depth limit = 4294967280
|
2014-08-08 20:18:18 +02:00
|
|
|
First code unit = 'a'
|
2014-10-06 19:28:42 +02:00
|
|
|
Last code unit = 'c'
|
2014-08-08 20:18:18 +02:00
|
|
|
Subject length lower bound = 3
|
|
|
|
|
2015-08-18 12:34:05 +02:00
|
|
|
/(a+)*zz/
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
No match
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=3000
|
|
|
|
Failed: error -47: match limit exceeded
|
|
|
|
|
|
|
|
/(a+)*zz/
|
2017-03-12 14:47:01 +01:00
|
|
|
aaaaaaaaaaaaaz\=depth_limit=10
|
|
|
|
Failed: error -53: matching depth limit exceeded
|
2015-08-18 12:34:05 +02:00
|
|
|
|
|
|
|
/(*LIMIT_MATCH=3000)(a+)*zz/I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
Match limit = 3000
|
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
Failed: error -47: match limit exceeded
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=60000
|
|
|
|
Failed: error -47: match limit exceeded
|
|
|
|
|
|
|
|
/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
Match limit = 3000
|
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
Failed: error -47: match limit exceeded
|
|
|
|
|
|
|
|
/(*LIMIT_MATCH=60000)(a+)*zz/I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
Match limit = 60000
|
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
No match
|
|
|
|
aaaaaaaaaaaaaz\=match_limit=3000
|
|
|
|
Failed: error -47: match limit exceeded
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
/(*LIMIT_DEPTH=10)(a+)*zz/I
|
2015-08-18 12:34:05 +02:00
|
|
|
Capturing subpattern count = 1
|
2017-03-12 14:47:01 +01:00
|
|
|
Depth limit = 10
|
2015-08-18 12:34:05 +02:00
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
2017-03-12 14:47:01 +01:00
|
|
|
Failed: error -53: matching depth limit exceeded
|
|
|
|
aaaaaaaaaaaaaz\=depth_limit=1000
|
|
|
|
Failed: error -53: matching depth limit exceeded
|
2015-08-18 12:34:05 +02:00
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
/(*LIMIT_DEPTH=10)(*LIMIT_DEPTH=1000)(a+)*zz/I
|
2015-08-18 12:34:05 +02:00
|
|
|
Capturing subpattern count = 1
|
2017-03-12 14:47:01 +01:00
|
|
|
Depth limit = 1000
|
2015-08-18 12:34:05 +02:00
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
No match
|
|
|
|
|
2017-03-12 14:47:01 +01:00
|
|
|
/(*LIMIT_DEPTH=1000)(a+)*zz/I
|
2015-08-18 12:34:05 +02:00
|
|
|
Capturing subpattern count = 1
|
2017-03-12 14:47:01 +01:00
|
|
|
Depth limit = 1000
|
2015-08-18 12:34:05 +02:00
|
|
|
Starting code units: a z
|
|
|
|
Last code unit = 'z'
|
|
|
|
Subject length lower bound = 2
|
|
|
|
aaaaaaaaaaaaaz
|
|
|
|
No match
|
2017-03-12 14:47:01 +01:00
|
|
|
aaaaaaaaaaaaaz\=depth_limit=10
|
|
|
|
Failed: error -53: matching depth limit exceeded
|
2015-08-18 12:34:05 +02:00
|
|
|
|
|
|
|
# These three have infinitely nested recursions.
|
|
|
|
|
|
|
|
/((?2))((?1))/
|
|
|
|
abc
|
|
|
|
Failed: error -52: nested recursion at the same subject position
|
|
|
|
|
2016-10-02 18:01:01 +02:00
|
|
|
/((?(R2)a+|(?1)b))()/
|
2015-08-18 12:34:05 +02:00
|
|
|
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
|
|
|
|
>>>>>
|
|
|
|
|
|
|
|
# These tests provoke recursion loops, which give a different error message
|
|
|
|
# when JIT is used.
|
|
|
|
|
|
|
|
/(?R)/I
|
2014-08-08 20:18:18 +02:00
|
|
|
Capturing subpattern count = 0
|
|
|
|
May match empty string
|
2014-10-06 19:28:42 +02:00
|
|
|
Subject length lower bound = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
abcd
|
|
|
|
Failed: error -52: nested recursion at the same subject position
|
|
|
|
|
|
|
|
/(a|(?R))/I
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
May match empty string
|
2015-11-11 10:42:26 +01:00
|
|
|
Subject length lower bound = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
abcd
|
|
|
|
0: a
|
|
|
|
1: a
|
|
|
|
defg
|
|
|
|
Failed: error -52: nested recursion at the same subject position
|
|
|
|
|
|
|
|
/(ab|(bc|(de|(?R))))/I
|
|
|
|
Capturing subpattern count = 3
|
|
|
|
May match empty string
|
2015-11-11 10:42:26 +01:00
|
|
|
Subject length lower bound = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
abcd
|
|
|
|
0: ab
|
|
|
|
1: ab
|
|
|
|
fghi
|
|
|
|
Failed: error -52: nested recursion at the same subject position
|
|
|
|
|
|
|
|
/(ab|(bc|(de|(?1))))/I
|
|
|
|
Capturing subpattern count = 3
|
|
|
|
May match empty string
|
2015-11-11 10:42:26 +01:00
|
|
|
Subject length lower bound = 0
|
2015-08-18 12:34:05 +02:00
|
|
|
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
|
|
|
|
Capturing subpattern 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
|
|
|
|
------------------------------------------------------------------
|
|
|
|
Capturing subpattern count = 1
|
|
|
|
Subject length lower bound = 1
|
|
|
|
abcd
|
|
|
|
Failed: error -52: nested recursion at the same subject position
|
2015-11-05 19:03:16 +01:00
|
|
|
|
|
|
|
# These tests don't behave the same with JIT
|
|
|
|
|
|
|
|
/\w+(?C1)/BI,no_auto_possess
|
|
|
|
------------------------------------------------------------------
|
|
|
|
Bra
|
|
|
|
\w+
|
|
|
|
Callout 1 8 0
|
|
|
|
Ket
|
|
|
|
End
|
|
|
|
------------------------------------------------------------------
|
|
|
|
Capturing subpattern 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
|
2017-12-22 16:56:27 +01:00
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
2015-11-05 19:03:16 +01:00
|
|
|
No match
|
|
|
|
|
|
|
|
/(*NO_AUTO_POSSESS)\w+(?C1)/BI
|
|
|
|
------------------------------------------------------------------
|
|
|
|
Bra
|
|
|
|
\w+
|
|
|
|
Callout 1 26 0
|
|
|
|
Ket
|
|
|
|
End
|
|
|
|
------------------------------------------------------------------
|
|
|
|
Capturing subpattern 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
|
2017-12-22 16:56:27 +01:00
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
|
|
|
1 ^ ^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
|
|
|
1 ^^ End of pattern
|
2015-11-05 19:03:16 +01:00
|
|
|
No match
|
2014-08-08 20:18:18 +02:00
|
|
|
|
2016-12-31 14:35:31 +01:00
|
|
|
# This test breaks the JIT stack limit
|
|
|
|
|
|
|
|
/(|]+){2,2452}/
|
|
|
|
(|]+){2,2452}
|
|
|
|
0:
|
|
|
|
1:
|
|
|
|
|
2017-04-16 15:03:30 +02:00
|
|
|
/(*LIMIT_HEAP=21)\[(a)]{60}/expand
|
|
|
|
\[a]{60}
|
|
|
|
Failed: error -63: heap limit exceeded
|
|
|
|
|
2015-01-23 17:51:47 +01:00
|
|
|
# End of testinput15
|