1// Copyright 2013 the V8 project authors. All rights reserved.
2// Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions
6// are met:
7// 1.  Redistributions of source code must retain the above copyright
8//     notice, this list of conditions and the following disclaimer.
9// 2.  Redistributions in binary form must reproduce the above copyright
10//     notice, this list of conditions and the following disclaimer in the
11//     documentation and/or other materials provided with the distribution.
12//
13// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16// DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
17// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
24description(
25"A chunk of our port of PCRE's test suite, adapted to be more applicable to JavaScript."
26);
27
28var regex0 = /a.b/;
29var input0 = "acb";
30var results = ["acb"];
31shouldBe('regex0.exec(input0);', 'results');
32var input1 = "a\x7fb";
33var results = ["a\u007fb"];
34shouldBe('regex0.exec(input1);', 'results');
35var input2 = "a\u0100b";
36var results = ["a\u0100b"];
37shouldBe('regex0.exec(input2);', 'results');
38// Failers
39var input3 = "a\nb";
40var results = null;
41shouldBe('regex0.exec(input3);', 'results');
42
43var regex1 = /a(.{3})b/;
44var input0 = "a\u4000xyb";
45var results = ["a\u4000xyb", "\u4000xy"];
46shouldBe('regex1.exec(input0);', 'results');
47var input1 = "a\u4000\x7fyb";
48var results = ["a\u4000\u007fyb", "\u4000\u007fy"];
49shouldBe('regex1.exec(input1);', 'results');
50var input2 = "a\u4000\u0100yb";
51var results = ["a\u4000\u0100yb", "\u4000\u0100y"];
52shouldBe('regex1.exec(input2);', 'results');
53// Failers
54var input3 = "a\u4000b";
55var results = null;
56shouldBe('regex1.exec(input3);', 'results');
57var input4 = "ac\ncb";
58var results = null;
59shouldBe('regex1.exec(input4);', 'results');
60
61var regex2 = /a(.*?)(.)/;
62var input0 = "a\xc0\x88b";
63var results = ["a\xc0", "", "\xc0"];
64shouldBe('regex2.exec(input0);', 'results');
65
66var regex3 = /a(.*?)(.)/;
67var input0 = "a\u0100b";
68var results = ["a\u0100", "", "\u0100"];
69shouldBe('regex3.exec(input0);', 'results');
70
71var regex4 = /a(.*)(.)/;
72var input0 = "a\xc0\x88b";
73var results = ["a\xc0\x88b", "\xc0\x88", "b"];
74shouldBe('regex4.exec(input0);', 'results');
75
76var regex5 = /a(.*)(.)/;
77var input0 = "a\u0100b";
78var results = ["a\u0100b", "\u0100", "b"];
79shouldBe('regex5.exec(input0);', 'results');
80
81var regex6 = /a(.)(.)/;
82var input0 = "a\xc0\x92bcd";
83var results = ["a\xc0\x92", "\xc0", "\x92"];
84shouldBe('regex6.exec(input0);', 'results');
85
86var regex7 = /a(.)(.)/;
87var input0 = "a\u0240bcd";
88var results = ["a\u0240b", "\u0240", "b"];
89shouldBe('regex7.exec(input0);', 'results');
90
91var regex8 = /a(.?)(.)/;
92var input0 = "a\xc0\x92bcd";
93var results = ["a\xc0\x92", "\xc0", "\x92"];
94shouldBe('regex8.exec(input0);', 'results');
95
96var regex9 = /a(.?)(.)/;
97var input0 = "a\u0240bcd";
98var results = ["a\u0240b", "\u0240", "b"];
99shouldBe('regex9.exec(input0);', 'results');
100
101var regex10 = /a(.??)(.)/;
102var input0 = "a\xc0\x92bcd";
103var results = ["a\xc0", "", "\xc0"];
104shouldBe('regex10.exec(input0);', 'results');
105
106var regex11 = /a(.??)(.)/;
107var input0 = "a\u0240bcd";
108var results = ["a\u0240", "", "\u0240"];
109shouldBe('regex11.exec(input0);', 'results');
110
111var regex12 = /a(.{3})b/;
112var input0 = "a\u1234xyb";
113var results = ["a\u1234xyb", "\u1234xy"];
114shouldBe('regex12.exec(input0);', 'results');
115var input1 = "a\u1234\u4321yb";
116var results = ["a\u1234\u4321yb", "\u1234\u4321y"];
117shouldBe('regex12.exec(input1);', 'results');
118var input2 = "a\u1234\u4321\u3412b";
119var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"];
120shouldBe('regex12.exec(input2);', 'results');
121// Failers
122var input3 = "a\u1234b";
123var results = null;
124shouldBe('regex12.exec(input3);', 'results');
125var input4 = "ac\ncb";
126var results = null;
127shouldBe('regex12.exec(input4);', 'results');
128
129var regex13 = /a(.{3,})b/;
130var input0 = "a\u1234xyb";
131var results = ["a\u1234xyb", "\u1234xy"];
132shouldBe('regex13.exec(input0);', 'results');
133var input1 = "a\u1234\u4321yb";
134var results = ["a\u1234\u4321yb", "\u1234\u4321y"];
135shouldBe('regex13.exec(input1);', 'results');
136var input2 = "a\u1234\u4321\u3412b";
137var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"];
138shouldBe('regex13.exec(input2);', 'results');
139var input3 = "axxxxbcdefghijb";
140var results = ["axxxxbcdefghijb", "xxxxbcdefghij"];
141shouldBe('regex13.exec(input3);', 'results');
142var input4 = "a\u1234\u4321\u3412\u3421b";
143var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"];
144shouldBe('regex13.exec(input4);', 'results');
145// Failers
146var input5 = "a\u1234b";
147var results = null;
148shouldBe('regex13.exec(input5);', 'results');
149
150var regex14 = /a(.{3,}?)b/;
151var input0 = "a\u1234xyb";
152var results = ["a\u1234xyb", "\u1234xy"];
153shouldBe('regex14.exec(input0);', 'results');
154var input1 = "a\u1234\u4321yb";
155var results = ["a\u1234\u4321yb", "\u1234\u4321y"];
156shouldBe('regex14.exec(input1);', 'results');
157var input2 = "a\u1234\u4321\u3412b";
158var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"];
159shouldBe('regex14.exec(input2);', 'results');
160var input3 = "axxxxbcdefghijb";
161var results = ["axxxxb", "xxxx"];
162shouldBe('regex14.exec(input3);', 'results');
163var input4 = "a\u1234\u4321\u3412\u3421b";
164var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"];
165shouldBe('regex14.exec(input4);', 'results');
166// Failers
167var input5 = "a\u1234b";
168var results = null;
169shouldBe('regex14.exec(input5);', 'results');
170
171var regex15 = /a(.{3,5})b/;
172var input0 = "a\u1234xyb";
173var results = ["a\u1234xyb", "\u1234xy"];
174shouldBe('regex15.exec(input0);', 'results');
175var input1 = "a\u1234\u4321yb";
176var results = ["a\u1234\u4321yb", "\u1234\u4321y"];
177shouldBe('regex15.exec(input1);', 'results');
178var input2 = "a\u1234\u4321\u3412b";
179var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"];
180shouldBe('regex15.exec(input2);', 'results');
181var input3 = "axxxxbcdefghijb";
182var results = ["axxxxb", "xxxx"];
183shouldBe('regex15.exec(input3);', 'results');
184var input4 = "a\u1234\u4321\u3412\u3421b";
185var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"];
186shouldBe('regex15.exec(input4);', 'results');
187var input5 = "axbxxbcdefghijb";
188var results = ["axbxxb", "xbxx"];
189shouldBe('regex15.exec(input5);', 'results');
190var input6 = "axxxxxbcdefghijb";
191var results = ["axxxxxb", "xxxxx"];
192shouldBe('regex15.exec(input6);', 'results');
193// Failers
194var input7 = "a\u1234b";
195var results = null;
196shouldBe('regex15.exec(input7);', 'results');
197var input8 = "axxxxxxbcdefghijb";
198var results = null;
199shouldBe('regex15.exec(input8);', 'results');
200
201var regex16 = /a(.{3,5}?)b/;
202var input0 = "a\u1234xyb";
203var results = ["a\u1234xyb", "\u1234xy"];
204shouldBe('regex16.exec(input0);', 'results');
205var input1 = "a\u1234\u4321yb";
206var results = ["a\u1234\u4321yb", "\u1234\u4321y"];
207shouldBe('regex16.exec(input1);', 'results');
208var input2 = "a\u1234\u4321\u3412b";
209var results = ["a\u1234\u4321\u3412b", "\u1234\u4321\u3412"];
210shouldBe('regex16.exec(input2);', 'results');
211var input3 = "axxxxbcdefghijb";
212var results = ["axxxxb", "xxxx"];
213shouldBe('regex16.exec(input3);', 'results');
214var input4 = "a\u1234\u4321\u3412\u3421b";
215var results = ["a\u1234\u4321\u3412\u3421b", "\u1234\u4321\u3412\u3421"];
216shouldBe('regex16.exec(input4);', 'results');
217var input5 = "axbxxbcdefghijb";
218var results = ["axbxxb", "xbxx"];
219shouldBe('regex16.exec(input5);', 'results');
220var input6 = "axxxxxbcdefghijb";
221var results = ["axxxxxb", "xxxxx"];
222shouldBe('regex16.exec(input6);', 'results');
223// Failers
224var input7 = "a\u1234b";
225var results = null;
226shouldBe('regex16.exec(input7);', 'results');
227var input8 = "axxxxxxbcdefghijb";
228var results = null;
229shouldBe('regex16.exec(input8);', 'results');
230
231var regex17 = /^[a\u00c0]/;
232// Failers
233var input0 = "\u0100";
234var results = null;
235shouldBe('regex17.exec(input0);', 'results');
236
237var regex21 = /(?:\u0100){3}b/;
238var input0 = "\u0100\u0100\u0100b";
239var results = ["\u0100\u0100\u0100b"];
240shouldBe('regex21.exec(input0);', 'results');
241// Failers
242var input1 = "\u0100\u0100b";
243var results = null;
244shouldBe('regex21.exec(input1);', 'results');
245
246var regex22 = /\u00ab/;
247var input0 = "\u00ab";
248var results = ["\u00ab"];
249shouldBe('regex22.exec(input0);', 'results');
250var input1 = "\xc2\xab";
251var results = ["\u00ab"];
252shouldBe('regex22.exec(input1);', 'results');
253// Failers
254var input2 = "\x00{ab}";
255var results = null;
256shouldBe('regex22.exec(input2);', 'results');
257
258var regex30 = /^[^a]{2}/;
259var input0 = "\u0100bc";
260var results = ["\u0100b"];
261shouldBe('regex30.exec(input0);', 'results');
262
263var regex31 = /^[^a]{2,}/;
264var input0 = "\u0100bcAa";
265var results = ["\u0100bcA"];
266shouldBe('regex31.exec(input0);', 'results');
267
268var regex32 = /^[^a]{2,}?/;
269var input0 = "\u0100bca";
270var results = ["\u0100b"];
271shouldBe('regex32.exec(input0);', 'results');
272
273var regex33 = /^[^a]{2}/i;
274var input0 = "\u0100bc";
275var results = ["\u0100b"];
276shouldBe('regex33.exec(input0);', 'results');
277
278var regex34 = /^[^a]{2,}/i;
279var input0 = "\u0100bcAa";
280var results = ["\u0100bc"];
281shouldBe('regex34.exec(input0);', 'results');
282
283var regex35 = /^[^a]{2,}?/i;
284var input0 = "\u0100bca";
285var results = ["\u0100b"];
286shouldBe('regex35.exec(input0);', 'results');
287
288var regex36 = /\u0100{0,0}/;
289var input0 = "abcd";
290var results = [""];
291shouldBe('regex36.exec(input0);', 'results');
292
293var regex37 = /\u0100?/;
294var input0 = "abcd";
295var results = [""];
296shouldBe('regex37.exec(input0);', 'results');
297var input1 = "\u0100\u0100";
298var results = ["\u0100"];
299shouldBe('regex37.exec(input1);', 'results');
300
301var regex38 = /\u0100{0,3}/;
302var input0 = "\u0100\u0100";
303var results = ["\u0100\u0100"];
304shouldBe('regex38.exec(input0);', 'results');
305var input1 = "\u0100\u0100\u0100\u0100";
306var results = ["\u0100\u0100\u0100"];
307shouldBe('regex38.exec(input1);', 'results');
308
309var regex39 = /\u0100*/;
310var input0 = "abce";
311var results = [""];
312shouldBe('regex39.exec(input0);', 'results');
313var input1 = "\u0100\u0100\u0100\u0100";
314var results = ["\u0100\u0100\u0100\u0100"];
315shouldBe('regex39.exec(input1);', 'results');
316
317var regex40 = /\u0100{1,1}/;
318var input0 = "abcd\u0100\u0100\u0100\u0100";
319var results = ["\u0100"];
320shouldBe('regex40.exec(input0);', 'results');
321
322var regex41 = /\u0100{1,3}/;
323var input0 = "abcd\u0100\u0100\u0100\u0100";
324var results = ["\u0100\u0100\u0100"];
325shouldBe('regex41.exec(input0);', 'results');
326
327var regex42 = /\u0100+/;
328var input0 = "abcd\u0100\u0100\u0100\u0100";
329var results = ["\u0100\u0100\u0100\u0100"];
330shouldBe('regex42.exec(input0);', 'results');
331
332var regex43 = /\u0100{3}/;
333var input0 = "abcd\u0100\u0100\u0100XX";
334var results = ["\u0100\u0100\u0100"];
335shouldBe('regex43.exec(input0);', 'results');
336
337var regex44 = /\u0100{3,5}/;
338var input0 = "abcd\u0100\u0100\u0100\u0100\u0100\u0100\u0100XX";
339var results = ["\u0100\u0100\u0100\u0100\u0100"];
340shouldBe('regex44.exec(input0);', 'results');
341
342var regex45 = /\u0100{3,}/;
343var input0 = "abcd\u0100\u0100\u0100\u0100\u0100\u0100\u0100XX";
344var results = ["\u0100\u0100\u0100\u0100\u0100\u0100\u0100"];
345shouldBe('regex45.exec(input0);', 'results');
346
347var regex47 = /\D*/;
348var input0 = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
349var results = ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"];
350shouldBe('regex47.exec(input0);', 'results');
351
352var regex48 = /\D*/;
353var input0 = "\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100";
354var results = ["\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100\u0100"];
355shouldBe('regex48.exec(input0);', 'results');
356
357var regex49 = /\D/;
358var input0 = "1X2";
359var results = ["X"];
360shouldBe('regex49.exec(input0);', 'results');
361var input1 = "1\u01002";
362var results = ["\u0100"];
363shouldBe('regex49.exec(input1);', 'results');
364
365var regex50 = />\S/;
366var input0 = "> >X Y";
367var results = [">X"];
368shouldBe('regex50.exec(input0);', 'results');
369var input1 = "> >\u0100 Y";
370var results = [">\u0100"];
371shouldBe('regex50.exec(input1);', 'results');
372
373var regex51 = /\d/;
374var input0 = "\u01003";
375var results = ["3"];
376shouldBe('regex51.exec(input0);', 'results');
377
378var regex52 = /\s/;
379var input0 = "\u0100 X";
380var results = [" "];
381shouldBe('regex52.exec(input0);', 'results');
382
383var regex53 = /\D+/;
384var input0 = "12abcd34";
385var results = ["abcd"];
386shouldBe('regex53.exec(input0);', 'results');
387// Failers
388var input1 = "1234";
389var results = null;
390shouldBe('regex53.exec(input1);', 'results');
391
392var regex54 = /\D{2,3}/;
393var input0 = "12abcd34";
394var results = ["abc"];
395shouldBe('regex54.exec(input0);', 'results');
396var input1 = "12ab34";
397var results = ["ab"];
398shouldBe('regex54.exec(input1);', 'results');
399// Failers
400var input2 = "1234";
401var results = null;
402shouldBe('regex54.exec(input2);', 'results');
403var input3 = "12a34";
404var results = null;
405shouldBe('regex54.exec(input3);', 'results');
406
407var regex55 = /\D{2,3}?/;
408var input0 = "12abcd34";
409var results = ["ab"];
410shouldBe('regex55.exec(input0);', 'results');
411var input1 = "12ab34";
412var results = ["ab"];
413shouldBe('regex55.exec(input1);', 'results');
414// Failers
415var input2 = "1234";
416var results = null;
417shouldBe('regex55.exec(input2);', 'results');
418var input3 = "12a34";
419var results = null;
420shouldBe('regex55.exec(input3);', 'results');
421
422var regex56 = /\d+/;
423var input0 = "12abcd34";
424var results = ["12"];
425shouldBe('regex56.exec(input0);', 'results');
426
427var regex57 = /\d{2,3}/;
428var input0 = "12abcd34";
429var results = ["12"];
430shouldBe('regex57.exec(input0);', 'results');
431var input1 = "1234abcd";
432var results = ["123"];
433shouldBe('regex57.exec(input1);', 'results');
434// Failers
435var input2 = "1.4";
436var results = null;
437shouldBe('regex57.exec(input2);', 'results');
438
439var regex58 = /\d{2,3}?/;
440var input0 = "12abcd34";
441var results = ["12"];
442shouldBe('regex58.exec(input0);', 'results');
443var input1 = "1234abcd";
444var results = ["12"];
445shouldBe('regex58.exec(input1);', 'results');
446// Failers
447var input2 = "1.4";
448var results = null;
449shouldBe('regex58.exec(input2);', 'results');
450
451var regex59 = /\S+/;
452var input0 = "12abcd34";
453var results = ["12abcd34"];
454shouldBe('regex59.exec(input0);', 'results');
455// Failers
456var input1 = "    ";
457var results = null;
458shouldBe('regex59.exec(input1);', 'results');
459
460var regex60 = /\S{2,3}/;
461var input0 = "12abcd34";
462var results = ["12a"];
463shouldBe('regex60.exec(input0);', 'results');
464var input1 = "1234abcd";
465var results = ["123"];
466shouldBe('regex60.exec(input1);', 'results');
467// Failers
468var input2 = "    ";
469var results = null;
470shouldBe('regex60.exec(input2);', 'results');
471
472var regex61 = /\S{2,3}?/;
473var input0 = "12abcd34";
474var results = ["12"];
475shouldBe('regex61.exec(input0);', 'results');
476var input1 = "1234abcd";
477var results = ["12"];
478shouldBe('regex61.exec(input1);', 'results');
479// Failers
480var input2 = "    ";
481var results = null;
482shouldBe('regex61.exec(input2);', 'results');
483
484var regex62 = />\s+</;
485var input0 = "12>      <34";
486var results = [">      <"];
487shouldBe('regex62.exec(input0);', 'results');
488
489var regex63 = />\s{2,3}</;
490var input0 = "ab>  <cd";
491var results = [">  <"];
492shouldBe('regex63.exec(input0);', 'results');
493var input1 = "ab>   <ce";
494var results = [">   <"];
495shouldBe('regex63.exec(input1);', 'results');
496// Failers
497var input2 = "ab>    <cd";
498var results = null;
499shouldBe('regex63.exec(input2);', 'results');
500
501var regex64 = />\s{2,3}?</;
502var input0 = "ab>  <cd";
503var results = [">  <"];
504shouldBe('regex64.exec(input0);', 'results');
505var input1 = "ab>   <ce";
506var results = [">   <"];
507shouldBe('regex64.exec(input1);', 'results');
508// Failers
509var input2 = "ab>    <cd";
510var results = null;
511shouldBe('regex64.exec(input2);', 'results');
512
513var regex65 = /\w+/;
514var input0 = "12      34";
515var results = ["12"];
516shouldBe('regex65.exec(input0);', 'results');
517// Failers
518var input1 = "+++=*!";
519var results = null;
520shouldBe('regex65.exec(input1);', 'results');
521
522var regex66 = /\w{2,3}/;
523var input0 = "ab  cd";
524var results = ["ab"];
525shouldBe('regex66.exec(input0);', 'results');
526var input1 = "abcd ce";
527var results = ["abc"];
528shouldBe('regex66.exec(input1);', 'results');
529// Failers
530var input2 = "a.b.c";
531var results = null;
532shouldBe('regex66.exec(input2);', 'results');
533
534var regex67 = /\w{2,3}?/;
535var input0 = "ab  cd";
536var results = ["ab"];
537shouldBe('regex67.exec(input0);', 'results');
538var input1 = "abcd ce";
539var results = ["ab"];
540shouldBe('regex67.exec(input1);', 'results');
541// Failers
542var input2 = "a.b.c";
543var results = null;
544shouldBe('regex67.exec(input2);', 'results');
545
546var regex68 = /\W+/;
547var input0 = "12====34";
548var results = ["===="];
549shouldBe('regex68.exec(input0);', 'results');
550// Failers
551var input1 = "abcd";
552var results = null;
553shouldBe('regex68.exec(input1);', 'results');
554
555var regex69 = /\W{2,3}/;
556var input0 = "ab====cd";
557var results = ["==="];
558shouldBe('regex69.exec(input0);', 'results');
559var input1 = "ab==cd";
560var results = ["=="];
561shouldBe('regex69.exec(input1);', 'results');
562// Failers
563var input2 = "a.b.c";
564var results = null;
565shouldBe('regex69.exec(input2);', 'results');
566
567var regex70 = /\W{2,3}?/;
568var input0 = "ab====cd";
569var results = ["=="];
570shouldBe('regex70.exec(input0);', 'results');
571var input1 = "ab==cd";
572var results = ["=="];
573shouldBe('regex70.exec(input1);', 'results');
574// Failers
575var input2 = "a.b.c";
576var results = null;
577shouldBe('regex70.exec(input2);', 'results');
578
579var regex71 = /[\u0100]/;
580var input0 = "\u0100";
581var results = ["\u0100"];
582shouldBe('regex71.exec(input0);', 'results');
583var input1 = "Z\u0100";
584var results = ["\u0100"];
585shouldBe('regex71.exec(input1);', 'results');
586var input2 = "\u0100Z";
587var results = ["\u0100"];
588shouldBe('regex71.exec(input2);', 'results');
589
590var regex72 = /[Z\u0100]/;
591var input0 = "Z\u0100";
592var results = ["Z"];
593shouldBe('regex72.exec(input0);', 'results');
594var input1 = "\u0100";
595var results = ["\u0100"];
596shouldBe('regex72.exec(input1);', 'results');
597var input2 = "\u0100Z";
598var results = ["\u0100"];
599shouldBe('regex72.exec(input2);', 'results');
600
601var regex73 = /[\u0100\u0200]/;
602var input0 = "ab\u0100cd";
603var results = ["\u0100"];
604shouldBe('regex73.exec(input0);', 'results');
605var input1 = "ab\u0200cd";
606var results = ["\u0200"];
607shouldBe('regex73.exec(input1);', 'results');
608
609var regex74 = /[\u0100-\u0200]/;
610var input0 = "ab\u0100cd";
611var results = ["\u0100"];
612shouldBe('regex74.exec(input0);', 'results');
613var input1 = "ab\u0200cd";
614var results = ["\u0200"];
615shouldBe('regex74.exec(input1);', 'results');
616var input2 = "ab\u0111cd";
617var results = ["\u0111"];
618shouldBe('regex74.exec(input2);', 'results');
619
620var regex75 = /[z-\u0200]/;
621var input0 = "ab\u0100cd";
622var results = ["\u0100"];
623shouldBe('regex75.exec(input0);', 'results');
624var input1 = "ab\u0200cd";
625var results = ["\u0200"];
626shouldBe('regex75.exec(input1);', 'results');
627var input2 = "ab\u0111cd";
628var results = ["\u0111"];
629shouldBe('regex75.exec(input2);', 'results');
630var input3 = "abzcd";
631var results = ["z"];
632shouldBe('regex75.exec(input3);', 'results');
633var input4 = "ab|cd";
634var results = ["|"];
635shouldBe('regex75.exec(input4);', 'results');
636
637var regex76 = /[Q\u0100\u0200]/;
638var input0 = "ab\u0100cd";
639var results = ["\u0100"];
640shouldBe('regex76.exec(input0);', 'results');
641var input1 = "ab\u0200cd";
642var results = ["\u0200"];
643shouldBe('regex76.exec(input1);', 'results');
644var input2 = "Q?";
645var results = ["Q"];
646shouldBe('regex76.exec(input2);', 'results');
647
648var regex77 = /[Q\u0100-\u0200]/;
649var input0 = "ab\u0100cd";
650var results = ["\u0100"];
651shouldBe('regex77.exec(input0);', 'results');
652var input1 = "ab\u0200cd";
653var results = ["\u0200"];
654shouldBe('regex77.exec(input1);', 'results');
655var input2 = "ab\u0111cd";
656var results = ["\u0111"];
657shouldBe('regex77.exec(input2);', 'results');
658var input3 = "Q?";
659var results = ["Q"];
660shouldBe('regex77.exec(input3);', 'results');
661
662var regex78 = /[Qz-\u0200]/;
663var input0 = "ab\u0100cd";
664var results = ["\u0100"];
665shouldBe('regex78.exec(input0);', 'results');
666var input1 = "ab\u0200cd";
667var results = ["\u0200"];
668shouldBe('regex78.exec(input1);', 'results');
669var input2 = "ab\u0111cd";
670var results = ["\u0111"];
671shouldBe('regex78.exec(input2);', 'results');
672var input3 = "abzcd";
673var results = ["z"];
674shouldBe('regex78.exec(input3);', 'results');
675var input4 = "ab|cd";
676var results = ["|"];
677shouldBe('regex78.exec(input4);', 'results');
678var input5 = "Q?";
679var results = ["Q"];
680shouldBe('regex78.exec(input5);', 'results');
681
682var regex79 = /[\u0100\u0200]{1,3}/;
683var input0 = "ab\u0100cd";
684var results = ["\u0100"];
685shouldBe('regex79.exec(input0);', 'results');
686var input1 = "ab\u0200cd";
687var results = ["\u0200"];
688shouldBe('regex79.exec(input1);', 'results');
689var input2 = "ab\u0200\u0100\u0200\u0100cd";
690var results = ["\u0200\u0100\u0200"];
691shouldBe('regex79.exec(input2);', 'results');
692
693var regex80 = /[\u0100\u0200]{1,3}?/;
694var input0 = "ab\u0100cd";
695var results = ["\u0100"];
696shouldBe('regex80.exec(input0);', 'results');
697var input1 = "ab\u0200cd";
698var results = ["\u0200"];
699shouldBe('regex80.exec(input1);', 'results');
700var input2 = "ab\u0200\u0100\u0200\u0100cd";
701var results = ["\u0200"];
702shouldBe('regex80.exec(input2);', 'results');
703
704var regex81 = /[Q\u0100\u0200]{1,3}/;
705var input0 = "ab\u0100cd";
706var results = ["\u0100"];
707shouldBe('regex81.exec(input0);', 'results');
708var input1 = "ab\u0200cd";
709var results = ["\u0200"];
710shouldBe('regex81.exec(input1);', 'results');
711var input2 = "ab\u0200\u0100\u0200\u0100cd";
712var results = ["\u0200\u0100\u0200"];
713shouldBe('regex81.exec(input2);', 'results');
714
715var regex82 = /[Q\u0100\u0200]{1,3}?/;
716var input0 = "ab\u0100cd";
717var results = ["\u0100"];
718shouldBe('regex82.exec(input0);', 'results');
719var input1 = "ab\u0200cd";
720var results = ["\u0200"];
721shouldBe('regex82.exec(input1);', 'results');
722var input2 = "ab\u0200\u0100\u0200\u0100cd";
723var results = ["\u0200"];
724shouldBe('regex82.exec(input2);', 'results');
725
726var regex86 = /[^\u0100\u0200]X/;
727var input0 = "AX";
728var results = ["AX"];
729shouldBe('regex86.exec(input0);', 'results');
730var input1 = "\u0150X";
731var results = ["\u0150X"];
732shouldBe('regex86.exec(input1);', 'results');
733var input2 = "\u0500X";
734var results = ["\u0500X"];
735shouldBe('regex86.exec(input2);', 'results');
736// Failers
737var input3 = "\u0100X";
738var results = null;
739shouldBe('regex86.exec(input3);', 'results');
740var input4 = "\u0200X";
741var results = null;
742shouldBe('regex86.exec(input4);', 'results');
743
744var regex87 = /[^Q\u0100\u0200]X/;
745var input0 = "AX";
746var results = ["AX"];
747shouldBe('regex87.exec(input0);', 'results');
748var input1 = "\u0150X";
749var results = ["\u0150X"];
750shouldBe('regex87.exec(input1);', 'results');
751var input2 = "\u0500X";
752var results = ["\u0500X"];
753shouldBe('regex87.exec(input2);', 'results');
754// Failers
755var input3 = "\u0100X";
756var results = null;
757shouldBe('regex87.exec(input3);', 'results');
758var input4 = "\u0200X";
759var results = null;
760shouldBe('regex87.exec(input4);', 'results');
761var input5 = "QX";
762var results = null;
763shouldBe('regex87.exec(input5);', 'results');
764
765var regex88 = /[^\u0100-\u0200]X/;
766var input0 = "AX";
767var results = ["AX"];
768shouldBe('regex88.exec(input0);', 'results');
769var input1 = "\u0500X";
770var results = ["\u0500X"];
771shouldBe('regex88.exec(input1);', 'results');
772// Failers
773var input2 = "\u0100X";
774var results = null;
775shouldBe('regex88.exec(input2);', 'results');
776var input3 = "\u0150X";
777var results = null;
778shouldBe('regex88.exec(input3);', 'results');
779var input4 = "\u0200X";
780var results = null;
781shouldBe('regex88.exec(input4);', 'results');
782
783var regex91 = /[z-\u0100]/i;
784var input0 = "z";
785var results = ["z"];
786shouldBe('regex91.exec(input0);', 'results');
787var input1 = "Z";
788var results = ["Z"];
789shouldBe('regex91.exec(input1);', 'results');
790var input2 = "\u0100";
791var results = ["\u0100"];
792shouldBe('regex91.exec(input2);', 'results');
793// Failers
794var input3 = "\u0102";
795var results = null;
796shouldBe('regex91.exec(input3);', 'results');
797var input4 = "y";
798var results = null;
799shouldBe('regex91.exec(input4);', 'results');
800
801var regex92 = /[\xFF]/;
802var input0 = ">\xff<";
803var results = ["\xff"];
804shouldBe('regex92.exec(input0);', 'results');
805
806var regex93 = /[\xff]/;
807var input0 = ">\u00ff<";
808var results = ["\u00ff"];
809shouldBe('regex93.exec(input0);', 'results');
810
811var regex94 = /[^\xFF]/;
812var input0 = "XYZ";
813var results = ["X"];
814shouldBe('regex94.exec(input0);', 'results');
815
816var regex95 = /[^\xff]/;
817var input0 = "XYZ";
818var results = ["X"];
819shouldBe('regex95.exec(input0);', 'results');
820var input1 = "\u0123";
821var results = ["\u0123"];
822shouldBe('regex95.exec(input1);', 'results');
823
824var regex96 = /^[ac]*b/;
825var input0 = "xb";
826var results = null;
827shouldBe('regex96.exec(input0);', 'results');
828
829var regex97 = /^[ac\u0100]*b/;
830var input0 = "xb";
831var results = null;
832shouldBe('regex97.exec(input0);', 'results');
833
834var regex98 = /^[^x]*b/i;
835var input0 = "xb";
836var results = null;
837shouldBe('regex98.exec(input0);', 'results');
838
839var regex99 = /^[^x]*b/;
840var input0 = "xb";
841var results = null;
842shouldBe('regex99.exec(input0);', 'results');
843
844var regex100 = /^\d*b/;
845var input0 = "xb";
846var results = null;
847shouldBe('regex100.exec(input0);', 'results');
848
849var regex102 = /^\u0085$/i;
850var input0 = "\u0085";
851var results = ["\u0085"];
852shouldBe('regex102.exec(input0);', 'results');
853
854var regex103 = /^\xe1\x88\xb4/;
855var input0 = "\xe1\x88\xb4";
856var results = ["\xe1\x88\xb4"];
857shouldBe('regex103.exec(input0);', 'results');
858
859var regex104 = /^\xe1\x88\xb4/;
860var input0 = "\xe1\x88\xb4";
861var results = ["\xe1\x88\xb4"];
862shouldBe('regex104.exec(input0);', 'results');
863
864var regex105 = /(.{1,5})/;
865var input0 = "abcdefg";
866var results = ["abcde", "abcde"];
867shouldBe('regex105.exec(input0);', 'results');
868var input1 = "ab";
869var results = ["ab", "ab"];
870shouldBe('regex105.exec(input1);', 'results');
871
872var regex106 = /a*\u0100*\w/;
873var input0 = "a";
874var results = ["a"];
875shouldBe('regex106.exec(input0);', 'results');
876
877var regex107 = /[\S\s]*/;
878var input0 = "abc\n\r\u0442\u0435\u0441\u0442xyz";
879var results = ["abc\u000a\u000d\u0442\u0435\u0441\u0442xyz"];
880shouldBe('regex107.exec(input0);', 'results');
881
882var regexGlobal0 = /[^a]+/g;
883var input0 = "bcd";
884var results = ["bcd"];
885shouldBe('input0.match(regexGlobal0);', 'results');
886var input1 = "\u0100aY\u0256Z";
887var results = ["\u0100", "Y\u0256Z"];
888shouldBe('input1.match(regexGlobal0);', 'results');
889
890var regexGlobal1 = /\S\S/g;
891var input0 = "A\u00a3BC";
892var results = ["A\u00a3", "BC"];
893shouldBe('input0.match(regexGlobal1);', 'results');
894
895var regexGlobal2 = /\S{2}/g;
896var input0 = "A\u00a3BC";
897var results = ["A\u00a3", "BC"];
898shouldBe('input0.match(regexGlobal2);', 'results');
899
900var regexGlobal3 = /\W\W/g;
901var input0 = "+\u00a3==";
902var results = ["+\u00a3", "=="];
903shouldBe('input0.match(regexGlobal3);', 'results');
904
905var regexGlobal4 = /\W{2}/g;
906var input0 = "+\u00a3==";
907var results = ["+\u00a3", "=="];
908shouldBe('input0.match(regexGlobal4);', 'results');
909
910var regexGlobal5 = /\S/g;
911var input0 = "\u0442\u0435\u0441\u0442";
912var results = ["\u0442", "\u0435", "\u0441", "\u0442"];
913shouldBe('input0.match(regexGlobal5);', 'results');
914
915var regexGlobal6 = /[\S]/g;
916var input0 = "\u0442\u0435\u0441\u0442";
917var results = ["\u0442", "\u0435", "\u0441", "\u0442"];
918shouldBe('input0.match(regexGlobal6);', 'results');
919
920var regexGlobal7 = /\D/g;
921var input0 = "\u0442\u0435\u0441\u0442";
922var results = ["\u0442", "\u0435", "\u0441", "\u0442"];
923shouldBe('input0.match(regexGlobal7);', 'results');
924
925var regexGlobal8 = /[\D]/g;
926var input0 = "\u0442\u0435\u0441\u0442";
927var results = ["\u0442", "\u0435", "\u0441", "\u0442"];
928shouldBe('input0.match(regexGlobal8);', 'results');
929
930var regexGlobal9 = /\W/g;
931var input0 = "\u2442\u2435\u2441\u2442";
932var results = ["\u2442", "\u2435", "\u2441", "\u2442"];
933shouldBe('input0.match(regexGlobal9);', 'results');
934
935var regexGlobal10 = /[\W]/g;
936var input0 = "\u2442\u2435\u2441\u2442";
937var results = ["\u2442", "\u2435", "\u2441", "\u2442"];
938shouldBe('input0.match(regexGlobal10);', 'results');
939
940var regexGlobal11 = /[\u041f\S]/g;
941var input0 = "\u0442\u0435\u0441\u0442";
942var results = ["\u0442", "\u0435", "\u0441", "\u0442"];
943shouldBe('input0.match(regexGlobal11);', 'results');
944
945var regexGlobal12 = /.[^\S]./g;
946var input0 = "abc def\u0442\u0443xyz\npqr";
947var results = ["c d", "z\u000ap"];
948shouldBe('input0.match(regexGlobal12);', 'results');
949
950var regexGlobal13 = /.[^\S\n]./g;
951var input0 = "abc def\u0442\u0443xyz\npqr";
952var results = ["c d"];
953shouldBe('input0.match(regexGlobal13);', 'results');
954
955var regexGlobal14 = /[\W]/g;
956var input0 = "+\u2442";
957var results = ["+", "\u2442"];
958shouldBe('input0.match(regexGlobal14);', 'results');
959
960var regexGlobal15 = /[^a-zA-Z]/g;
961var input0 = "+\u2442";
962var results = ["+", "\u2442"];
963shouldBe('input0.match(regexGlobal15);', 'results');
964
965var regexGlobal16 = /[^a-zA-Z]/g;
966var input0 = "A\u0442";
967var results = ["\u0442"];
968shouldBe('input0.match(regexGlobal16);', 'results');
969
970var regexGlobal17 = /[\S]/g;
971var input0 = "A\u0442";
972var results = ["A", "\u0442"];
973shouldBe('input0.match(regexGlobal17);', 'results');
974
975var regexGlobal19 = /[\D]/g;
976var input0 = "A\u0442";
977var results = ["A", "\u0442"];
978shouldBe('input0.match(regexGlobal19);', 'results');
979
980var regexGlobal21 = /[^a-z]/g;
981var input0 = "A\u0422";
982var results = ["A", "\u0422"];
983shouldBe('input0.match(regexGlobal21);', 'results');
984
985var regexGlobal24 = /[\S]/g;
986var input0 = "A\u0442";
987var results = ["A", "\u0442"];
988shouldBe('input0.match(regexGlobal24);', 'results');
989
990var regexGlobal25 = /[^A-Z]/g;
991var input0 = "a\u0442";
992var results = ["a", "\u0442"];
993shouldBe('input0.match(regexGlobal25);', 'results');
994
995var regexGlobal26 = /[\W]/g;
996var input0 = "+\u2442";
997var results = ["+", "\u2442"];
998shouldBe('input0.match(regexGlobal26);', 'results');
999
1000var regexGlobal27 = /[\D]/g;
1001var input0 = "M\u0442";
1002var results = ["M", "\u0442"];
1003shouldBe('input0.match(regexGlobal27);', 'results');
1004
1005var regexGlobal28 = /[^a]+/ig;
1006var input0 = "bcd";
1007var results = ["bcd"];
1008shouldBe('input0.match(regexGlobal28);', 'results');
1009var input1 = "\u0100aY\u0256Z";
1010var results = ["\u0100", "Y\u0256Z"];
1011shouldBe('input1.match(regexGlobal28);', 'results');
1012
1013var regexGlobal29 = /(a|)/g;
1014var input0 = "catac";
1015var results = ["", "a", "", "a", "", ""];
1016shouldBe('input0.match(regexGlobal29);', 'results');
1017var input1 = "a\u0256a";
1018var results = ["a", "", "a", ""];
1019shouldBe('input1.match(regexGlobal29);', 'results');
1020
1021// DISABLED:
1022// These tests use (?<) or (?>) constructs. These are not currently valid in ECMAScript,
1023// but these tests may be useful if similar constructs are introduced in the future.
1024
1025//var regex18 = /(?<=aXb)cd/;
1026//var input0 = "aXbcd";
1027//var results = ["cd"];
1028//shouldBe('regex18.exec(input0);', 'results');
1029//
1030//var regex19 = /(?<=a\u0100b)cd/;
1031//var input0 = "a\u0100bcd";
1032//var results = ["cd"];
1033//shouldBe('regex19.exec(input0);', 'results');
1034//
1035//var regex20 = /(?<=a\u100000b)cd/;
1036//var input0 = "a\u100000bcd";
1037//var results = ["cd"];
1038//shouldBe('regex20.exec(input0);', 'results');
1039//
1040//var regex23 = /(?<=(.))X/;
1041//var input0 = "WXYZ";
1042//var results = ["X", "W"];
1043//shouldBe('regex23.exec(input0);', 'results');
1044//var input1 = "\u0256XYZ";
1045//var results = ["X", "\u0256"];
1046//shouldBe('regex23.exec(input1);', 'results');
1047//// Failers
1048//var input2 = "XYZ";
1049//var results = null;
1050//shouldBe('regex23.exec(input2);', 'results');
1051//
1052//var regex46 = /(?<=a\u0100{2}b)X/;
1053//var input0 = "Xyyya\u0100\u0100bXzzz";
1054//var results = ["X"];
1055//shouldBe('regex46.exec(input0);', 'results');
1056//
1057//var regex83 = /(?<=[\u0100\u0200])X/;
1058//var input0 = "abc\u0200X";
1059//var results = ["X"];
1060//shouldBe('regex83.exec(input0);', 'results');
1061//var input1 = "abc\u0100X";
1062//var results = ["X"];
1063//shouldBe('regex83.exec(input1);', 'results');
1064//// Failers
1065//var input2 = "X";
1066//var results = null;
1067//shouldBe('regex83.exec(input2);', 'results');
1068//
1069//var regex84 = /(?<=[Q\u0100\u0200])X/;
1070//var input0 = "abc\u0200X";
1071//var results = ["X"];
1072//shouldBe('regex84.exec(input0);', 'results');
1073//var input1 = "abc\u0100X";
1074//var results = ["X"];
1075//shouldBe('regex84.exec(input1);', 'results');
1076//var input2 = "abQX";
1077//var results = ["X"];
1078//shouldBe('regex84.exec(input2);', 'results');
1079//// Failers
1080//var input3 = "X";
1081//var results = null;
1082//shouldBe('regex84.exec(input3);', 'results');
1083//
1084//var regex85 = /(?<=[\u0100\u0200]{3})X/;
1085//var input0 = "abc\u0100\u0200\u0100X";
1086//var results = ["X"];
1087//shouldBe('regex85.exec(input0);', 'results');
1088//// Failers
1089//var input1 = "abc\u0200X";
1090//var results = null;
1091//shouldBe('regex85.exec(input1);', 'results');
1092//var input2 = "X";
1093//var results = null;
1094//shouldBe('regex85.exec(input2);', 'results');
1095
1096// DISABLED:
1097// These tests use PCRE's \C token. This is not currently valid in ECMAScript,
1098// but these tests may be useful if similar constructs are introduced in the future.
1099
1100//var regex24 = /X(\C{3})/;
1101//var input0 = "X\u1234";
1102//var results = ["X\u1234", "\u1234"];
1103//shouldBe('regex24.exec(input0);', 'results');
1104//
1105//var regex25 = /X(\C{4})/;
1106//var input0 = "X\u1234YZ";
1107//var results = ["X\u1234Y", "\u1234Y"];
1108//shouldBe('regex25.exec(input0);', 'results');
1109//
1110//var regex26 = /X\C*/;
1111//var input0 = "XYZabcdce";
1112//var results = ["XYZabcdce"];
1113//shouldBe('regex26.exec(input0);', 'results');
1114//
1115//var regex27 = /X\C*?/;
1116//var input0 = "XYZabcde";
1117//var results = ["X"];
1118//shouldBe('regex27.exec(input0);', 'results');
1119//
1120//var regex28 = /X\C{3,5}/;
1121//var input0 = "Xabcdefg";
1122//var results = ["Xabcde"];
1123//shouldBe('regex28.exec(input0);', 'results');
1124//var input1 = "X\u1234";
1125//var results = ["X\u1234"];
1126//shouldBe('regex28.exec(input1);', 'results');
1127//var input2 = "X\u1234YZ";
1128//var results = ["X\u1234YZ"];
1129//shouldBe('regex28.exec(input2);', 'results');
1130//var input3 = "X\u1234\u0512";
1131//var results = ["X\u1234\u0512"];
1132//shouldBe('regex28.exec(input3);', 'results');
1133//var input4 = "X\u1234\u0512YZ";
1134//var results = ["X\u1234\u0512"];
1135//shouldBe('regex28.exec(input4);', 'results');
1136//
1137//var regex29 = /X\C{3,5}?/;
1138//var input0 = "Xabcdefg";
1139//var results = ["Xabc"];
1140//shouldBe('regex29.exec(input0);', 'results');
1141//var input1 = "X\u1234";
1142//var results = ["X\u1234"];
1143//shouldBe('regex29.exec(input1);', 'results');
1144//var input2 = "X\u1234YZ";
1145//var results = ["X\u1234"];
1146//shouldBe('regex29.exec(input2);', 'results');
1147//var input3 = "X\u1234\u0512";
1148//var results = ["X\u1234"];
1149//shouldBe('regex29.exec(input3);', 'results');
1150//
1151//var regex89 = /a\Cb/;
1152//var input0 = "aXb";
1153//var results = ["aXb"];
1154//shouldBe('regex89.exec(input0);', 'results');
1155//var input1 = "a\nb";
1156//var results = ["a\x0ab"];
1157//shouldBe('regex89.exec(input1);', 'results');
1158//
1159//var regex90 = /a\Cb/;
1160//var input0 = "aXb";
1161//var results = ["aXb"];
1162//shouldBe('regex90.exec(input0);', 'results');
1163//var input1 = "a\nb";
1164//var results = ["a\u000ab"];
1165//shouldBe('regex90.exec(input1);', 'results');
1166//// Failers
1167//var input2 = "a\u0100b";
1168//var results = null;
1169//shouldBe('regex90.exec(input2);', 'results');
1170