• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# These are:
2#
3# (1) Tests of the match-limiting features. The results are different for
4# interpretive or JIT matching, so this test should not be run with JIT. The
5# same tests are run using JIT in test 17.
6
7# (2) Other tests that must not be run with JIT.
8
9/(a+)*zz/I
10Capturing subpattern count = 1
11Starting code units: a z
12Last code unit = 'z'
13Subject length lower bound = 2
14  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazzbbbbbb\=find_limits
15Minimum match limit = 8
16Minimum recursion limit = 6
17 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazz
18 1: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
19  aaaaaaaaaaaaaz\=find_limits
20Minimum match limit = 32768
21Minimum recursion limit = 29
22No match
23
24!((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)!I
25Capturing subpattern count = 1
26May match empty string
27Subject length lower bound = 0
28   /* this is a C style comment */\=find_limits
29Minimum match limit = 120
30Minimum recursion limit = 6
31 0: /* this is a C style comment */
32 1: /* this is a C style comment */
33
34/^(?>a)++/
35    aa\=find_limits
36Minimum match limit = 5
37Minimum recursion limit = 2
38 0: aa
39    aaaaaaaaa\=find_limits
40Minimum match limit = 12
41Minimum recursion limit = 2
42 0: aaaaaaaaa
43
44/(a)(?1)++/
45    aa\=find_limits
46Minimum match limit = 7
47Minimum recursion limit = 4
48 0: aa
49 1: a
50    aaaaaaaaa\=find_limits
51Minimum match limit = 21
52Minimum recursion limit = 4
53 0: aaaaaaaaa
54 1: a
55
56/a(?:.)*?a/ims
57    abbbbbbbbbbbbbbbbbbbbba\=find_limits
58Minimum match limit = 65
59Minimum recursion limit = 2
60 0: abbbbbbbbbbbbbbbbbbbbba
61
62/a(?:.(*THEN))*?a/ims
63    abbbbbbbbbbbbbbbbbbbbba\=find_limits
64Minimum match limit = 86
65Minimum recursion limit = 45
66 0: abbbbbbbbbbbbbbbbbbbbba
67
68/a(?:.(*THEN:ABC))*?a/ims
69    abbbbbbbbbbbbbbbbbbbbba\=find_limits
70Minimum match limit = 86
71Minimum recursion limit = 45
72 0: abbbbbbbbbbbbbbbbbbbbba
73
74/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
75     aabbccddee\=find_limits
76Minimum match limit = 7
77Minimum recursion limit = 2
78 0: aabbccddee
79
80/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
81     aabbccddee\=find_limits
82Minimum match limit = 17
83Minimum recursion limit = 16
84 0: aabbccddee
85 1: aa
86 2: bb
87 3: cc
88 4: dd
89 5: ee
90
91/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
92     aabbccddee\=find_limits
93Minimum match limit = 13
94Minimum recursion limit = 10
95 0: aabbccddee
96 1: aa
97 2: cc
98 3: ee
99
100/(*LIMIT_MATCH=12bc)abc/
101Failed: error 160 at offset 17: (*VERB) not recognized or malformed
102
103/(*LIMIT_MATCH=4294967290)abc/
104Failed: error 160 at offset 24: (*VERB) not recognized or malformed
105
106/(*LIMIT_RECURSION=4294967280)abc/I
107Capturing subpattern count = 0
108Recursion limit = 4294967280
109First code unit = 'a'
110Last code unit = 'c'
111Subject length lower bound = 3
112
113/(a+)*zz/
114    aaaaaaaaaaaaaz
115No match
116    aaaaaaaaaaaaaz\=match_limit=3000
117Failed: error -47: match limit exceeded
118
119/(a+)*zz/
120    aaaaaaaaaaaaaz\=recursion_limit=10
121Failed: error -53: recursion limit exceeded
122
123/(*LIMIT_MATCH=3000)(a+)*zz/I
124Capturing subpattern count = 1
125Match limit = 3000
126Starting code units: a z
127Last code unit = 'z'
128Subject length lower bound = 2
129    aaaaaaaaaaaaaz
130Failed: error -47: match limit exceeded
131    aaaaaaaaaaaaaz\=match_limit=60000
132Failed: error -47: match limit exceeded
133
134/(*LIMIT_MATCH=60000)(*LIMIT_MATCH=3000)(a+)*zz/I
135Capturing subpattern count = 1
136Match limit = 3000
137Starting code units: a z
138Last code unit = 'z'
139Subject length lower bound = 2
140    aaaaaaaaaaaaaz
141Failed: error -47: match limit exceeded
142
143/(*LIMIT_MATCH=60000)(a+)*zz/I
144Capturing subpattern count = 1
145Match limit = 60000
146Starting code units: a z
147Last code unit = 'z'
148Subject length lower bound = 2
149    aaaaaaaaaaaaaz
150No match
151    aaaaaaaaaaaaaz\=match_limit=3000
152Failed: error -47: match limit exceeded
153
154/(*LIMIT_RECURSION=10)(a+)*zz/I
155Capturing subpattern count = 1
156Recursion limit = 10
157Starting code units: a z
158Last code unit = 'z'
159Subject length lower bound = 2
160    aaaaaaaaaaaaaz
161Failed: error -53: recursion limit exceeded
162    aaaaaaaaaaaaaz\=recursion_limit=1000
163Failed: error -53: recursion limit exceeded
164
165/(*LIMIT_RECURSION=10)(*LIMIT_RECURSION=1000)(a+)*zz/I
166Capturing subpattern count = 1
167Recursion limit = 1000
168Starting code units: a z
169Last code unit = 'z'
170Subject length lower bound = 2
171    aaaaaaaaaaaaaz
172No match
173
174/(*LIMIT_RECURSION=1000)(a+)*zz/I
175Capturing subpattern count = 1
176Recursion limit = 1000
177Starting code units: a z
178Last code unit = 'z'
179Subject length lower bound = 2
180    aaaaaaaaaaaaaz
181No match
182    aaaaaaaaaaaaaz\=recursion_limit=10
183Failed: error -53: recursion limit exceeded
184
185# These three have infinitely nested recursions.
186
187/((?2))((?1))/
188    abc
189Failed: error -52: nested recursion at the same subject position
190
191/((?(R2)a+|(?1)b))/
192    aaaabcde
193Failed: error -52: nested recursion at the same subject position
194
195/(?(R)a*(?1)|((?R))b)/
196    aaaabcde
197Failed: error -52: nested recursion at the same subject position
198
199# The allusedtext modifier does not work with JIT, which does not maintain
200# the leftchar/rightchar data.
201
202/abc(?=xyz)/allusedtext
203    abcxyzpqr
204 0: abcxyz
205       >>>
206    abcxyzpqr\=aftertext
207 0: abcxyz
208       >>>
209 0+ xyzpqr
210
211/(?<=pqr)abc(?=xyz)/allusedtext
212    xyzpqrabcxyzpqr
213 0: pqrabcxyz
214    <<<   >>>
215    xyzpqrabcxyzpqr\=aftertext
216 0: pqrabcxyz
217    <<<   >>>
218 0+ xyzpqr
219
220/a\b/
221    a.\=allusedtext
222 0: a.
223     >
224    a\=allusedtext
225 0: a
226
227/abc\Kxyz/
228    abcxyz\=allusedtext
229 0: abcxyz
230    <<<
231
232/abc(?=xyz(*ACCEPT))/
233    abcxyz\=allusedtext
234 0: abcxyz
235       >>>
236
237/abc(?=abcde)(?=ab)/allusedtext
238    abcabcdefg
239 0: abcabcde
240       >>>>>
241
242# These tests provoke recursion loops, which give a different error message
243# when JIT is used.
244
245/(?R)/I
246Capturing subpattern count = 0
247May match empty string
248Subject length lower bound = 0
249    abcd
250Failed: error -52: nested recursion at the same subject position
251
252/(a|(?R))/I
253Capturing subpattern count = 1
254May match empty string
255Subject length lower bound = 0
256    abcd
257 0: a
258 1: a
259    defg
260Failed: error -52: nested recursion at the same subject position
261
262/(ab|(bc|(de|(?R))))/I
263Capturing subpattern count = 3
264May match empty string
265Subject length lower bound = 0
266    abcd
267 0: ab
268 1: ab
269    fghi
270Failed: error -52: nested recursion at the same subject position
271
272/(ab|(bc|(de|(?1))))/I
273Capturing subpattern count = 3
274May match empty string
275Subject length lower bound = 0
276    abcd
277 0: ab
278 1: ab
279    fghi
280Failed: error -52: nested recursion at the same subject position
281
282/x(ab|(bc|(de|(?1)x)x)x)/I
283Capturing subpattern count = 3
284First code unit = 'x'
285Subject length lower bound = 3
286    xab123
287 0: xab
288 1: ab
289    xfghi
290Failed: error -52: nested recursion at the same subject position
291
292/(?!\w)(?R)/
293    abcd
294Failed: error -52: nested recursion at the same subject position
295    =abc
296Failed: error -52: nested recursion at the same subject position
297
298/(?=\w)(?R)/
299    =abc
300Failed: error -52: nested recursion at the same subject position
301    abcd
302Failed: error -52: nested recursion at the same subject position
303
304/(?<!\w)(?R)/
305    abcd
306Failed: error -52: nested recursion at the same subject position
307
308/(?<=\w)(?R)/
309    abcd
310Failed: error -52: nested recursion at the same subject position
311
312/(a+|(?R)b)/
313    aaa
314 0: aaa
315 1: aaa
316    bbb
317Failed: error -52: nested recursion at the same subject position
318
319/[^\xff]((?1))/BI
320------------------------------------------------------------------
321        Bra
322        [^\x{ff}]
323        CBra 1
324        Recurse
325        Ket
326        Ket
327        End
328------------------------------------------------------------------
329Capturing subpattern count = 1
330Subject length lower bound = 1
331    abcd
332Failed: error -52: nested recursion at the same subject position
333
334# These tests don't behave the same with JIT
335
336/\w+(?C1)/BI,no_auto_possess
337------------------------------------------------------------------
338        Bra
339        \w+
340        Callout 1 8 0
341        Ket
342        End
343------------------------------------------------------------------
344Capturing subpattern count = 0
345Options: no_auto_possess
346Starting 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
347  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
348Subject length lower bound = 1
349    abc\=callout_fail=1
350--->abc
351  1 ^  ^
352  1 ^ ^
353  1 ^^
354  1  ^ ^
355  1  ^^
356  1   ^^
357No match
358
359/(*NO_AUTO_POSSESS)\w+(?C1)/BI
360------------------------------------------------------------------
361        Bra
362        \w+
363        Callout 1 26 0
364        Ket
365        End
366------------------------------------------------------------------
367Capturing subpattern count = 0
368Compile options: <none>
369Overall options: no_auto_possess
370Starting 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
371  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
372Subject length lower bound = 1
373    abc\=callout_fail=1
374--->abc
375  1 ^  ^
376  1 ^ ^
377  1 ^^
378  1  ^ ^
379  1  ^^
380  1   ^^
381No match
382
383# End of testinput15
384