1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is JavaScript Engine testing utilities.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corp.
19 * Portions created by the Initial Developer are Copyright (C) 2002
20 * the Initial Developer. All Rights Reserved.
23 * pschwartau@netscape.com, rogerl@netscape.com
25 * Alternatively, the contents of this file may be used under the terms of
26 * either the GNU General Public License Version 2 or later (the "GPL"), or
27 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
28 * in which case the provisions of the GPL or the LGPL are applicable instead
29 * of those above. If you wish to allow use of your version of this file only
30 * under the terms of either the GPL or the LGPL, and not to allow others to
31 * use your version of this file under the terms of the MPL, indicate your
32 * decision by deleting the provisions above and replace them with the notice
33 * and other provisions required by the GPL or the LGPL. If you do not delete
34 * the provisions above, a recipient may use your version of this file under
35 * the terms of any one of the MPL, the GPL or the LGPL.
37 * ***** END LICENSE BLOCK ***** */
42 * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
43 * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
45 * This test was created by running various patterns and strings through the
46 * Perl 5 RegExp engine. We saved the results below to test the JS engine.
48 * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
49 * out such sections altogether, or modified them to fit what we expect from JS.
53 * - In JS, regexp captures (/(a) etc./) must hold |undefined| if not used.
54 * See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
55 * By contrast, in Perl, unmatched captures hold the empty string.
56 * We have modified such sections accordingly. Example:
58 pattern = /^([^a-z])|(\^)$/;
60 actualmatch = string.match(pattern);
61 //expectedmatch = Array('.', '.', ''); <<<--- Perl
62 expectedmatch = Array('.', '.', undefined); <<<--- JS
66 * - In JS, you can't refer to a capture before it's encountered & completed
68 * - Perl supports ] & ^] inside a [], ECMA does not
70 * - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc.
72 * - ECMA doesn't support (?imsx or (?-imsx
74 * - ECMA doesn't support (?(condition)
76 * - Perl has \Z has end-of-line, ECMA doesn't
78 * - In ECMA, ^ matches only the empty string before the first character
80 * - In ECMA, $ matches only the empty string at end of input (unless multiline)
82 * - ECMA spec says that each atom in a range must be a single character
84 * - ECMA doesn't support \A
86 * - ECMA doesn't have rules for [:
89 //-----------------------------------------------------------------------------
90 var gTestfile = 'perlstress-001.js';
92 var BUGNUMBER = 85721;
93 var summary = 'Testing regular expression edge cases';
94 var cnSingleSpace = ' ';
96 var statusmessages = new Array();
98 var patterns = new Array();
100 var strings = new Array();
101 var actualmatch = '';
102 var actualmatches = new Array();
103 var expectedmatch = '';
104 var expectedmatches = new Array();
109 status = inSection(1);
112 actualmatch = string.match(pattern);
113 expectedmatch = Array('abc');
116 status = inSection(2);
119 actualmatch = string.match(pattern);
120 expectedmatch = Array('abc');
123 status = inSection(3);
126 actualmatch = string.match(pattern);
127 expectedmatch = Array('abc');
130 status = inSection(4);
133 actualmatch = string.match(pattern);
134 expectedmatch = Array('abc');
137 status = inSection(5);
140 actualmatch = string.match(pattern);
141 expectedmatch = Array('abc');
144 status = inSection(6);
147 actualmatch = string.match(pattern);
148 expectedmatch = Array('abbc');
151 status = inSection(7);
154 actualmatch = string.match(pattern);
155 expectedmatch = Array('abbbbc');
158 status = inSection(8);
161 actualmatch = string.match(pattern);
162 expectedmatch = Array('a');
165 status = inSection(9);
168 actualmatch = string.match(pattern);
169 expectedmatch = Array('abbb');
172 status = inSection(10);
173 pattern = /ab{0,}bc/;
175 actualmatch = string.match(pattern);
176 expectedmatch = Array('abbbbc');
179 status = inSection(11);
182 actualmatch = string.match(pattern);
183 expectedmatch = Array('abbc');
186 status = inSection(12);
189 actualmatch = string.match(pattern);
190 expectedmatch = Array('abbbbc');
193 status = inSection(13);
194 pattern = /ab{1,}bc/;
196 actualmatch = string.match(pattern);
197 expectedmatch = Array('abbbbc');
200 status = inSection(14);
201 pattern = /ab{1,3}bc/;
203 actualmatch = string.match(pattern);
204 expectedmatch = Array('abbbbc');
207 status = inSection(15);
208 pattern = /ab{3,4}bc/;
210 actualmatch = string.match(pattern);
211 expectedmatch = Array('abbbbc');
214 status = inSection(16);
217 actualmatch = string.match(pattern);
218 expectedmatch = Array('abbc');
221 status = inSection(17);
224 actualmatch = string.match(pattern);
225 expectedmatch = Array('abc');
228 status = inSection(18);
229 pattern = /ab{0,1}bc/;
231 actualmatch = string.match(pattern);
232 expectedmatch = Array('abc');
235 status = inSection(19);
238 actualmatch = string.match(pattern);
239 expectedmatch = Array('abc');
242 status = inSection(20);
243 pattern = /ab{0,1}c/;
245 actualmatch = string.match(pattern);
246 expectedmatch = Array('abc');
249 status = inSection(21);
252 actualmatch = string.match(pattern);
253 expectedmatch = Array('abc');
256 status = inSection(22);
259 actualmatch = string.match(pattern);
260 expectedmatch = Array('abc');
263 status = inSection(23);
266 actualmatch = string.match(pattern);
267 expectedmatch = Array('abc');
270 status = inSection(24);
273 actualmatch = string.match(pattern);
274 expectedmatch = Array('');
277 status = inSection(25);
280 actualmatch = string.match(pattern);
281 expectedmatch = Array('');
284 status = inSection(26);
287 actualmatch = string.match(pattern);
288 expectedmatch = Array('abc');
291 status = inSection(27);
294 actualmatch = string.match(pattern);
295 expectedmatch = Array('axc');
298 status = inSection(28);
301 actualmatch = string.match(pattern);
302 expectedmatch = Array('axyzc');
305 status = inSection(29);
308 actualmatch = string.match(pattern);
309 expectedmatch = Array('abd');
312 status = inSection(30);
315 actualmatch = string.match(pattern);
316 expectedmatch = Array('ace');
319 status = inSection(31);
322 actualmatch = string.match(pattern);
323 expectedmatch = Array('ac');
326 status = inSection(32);
329 actualmatch = string.match(pattern);
330 expectedmatch = Array('a-');
333 status = inSection(33);
336 actualmatch = string.match(pattern);
337 expectedmatch = Array('a-');
340 status = inSection(34);
343 actualmatch = string.match(pattern);
344 expectedmatch = Array('a]');
347 /* Perl supports ] & ^] inside a [], ECMA does not
349 status = inSection(35);
351 actualmatch = string.match(pattern);
352 expectedmatch = Array('a]b');
356 status = inSection(36);
359 actualmatch = string.match(pattern);
360 expectedmatch = Array('aed');
363 status = inSection(37);
366 actualmatch = string.match(pattern);
367 expectedmatch = Array('adc');
370 /* Perl supports ] & ^] inside a [], ECMA does not
371 status = inSection(38);
374 actualmatch = string.match(pattern);
375 expectedmatch = Array('adc');
379 status = inSection(39);
382 actualmatch = string.match(pattern);
383 expectedmatch = Array('a');
386 status = inSection(40);
389 actualmatch = string.match(pattern);
390 expectedmatch = Array('a');
393 status = inSection(41);
396 actualmatch = string.match(pattern);
397 expectedmatch = Array('a');
400 status = inSection(42);
403 actualmatch = string.match(pattern);
404 expectedmatch = Array('y');
407 status = inSection(43);
410 actualmatch = string.match(pattern);
411 expectedmatch = Array('y');
414 status = inSection(44);
417 actualmatch = string.match(pattern);
418 expectedmatch = Array('y');
421 status = inSection(45);
424 actualmatch = string.match(pattern);
425 expectedmatch = Array('a');
428 status = inSection(46);
431 actualmatch = string.match(pattern);
432 expectedmatch = Array('-');
435 status = inSection(47);
438 actualmatch = string.match(pattern);
439 expectedmatch = Array('a-b');
442 status = inSection(48);
445 actualmatch = string.match(pattern);
446 expectedmatch = Array('1');
449 status = inSection(49);
452 actualmatch = string.match(pattern);
453 expectedmatch = Array('-');
456 status = inSection(50);
459 actualmatch = string.match(pattern);
460 expectedmatch = Array('a');
463 status = inSection(51);
466 actualmatch = string.match(pattern);
467 expectedmatch = Array('-');
470 status = inSection(52);
473 actualmatch = string.match(pattern);
474 expectedmatch = Array('a-b');
477 status = inSection(53);
480 actualmatch = string.match(pattern);
481 expectedmatch = Array('1');
484 status = inSection(54);
487 actualmatch = string.match(pattern);
488 expectedmatch = Array('-');
491 status = inSection(55);
494 actualmatch = string.match(pattern);
495 expectedmatch = Array('ab');
498 status = inSection(56);
501 actualmatch = string.match(pattern);
502 expectedmatch = Array('ab');
505 status = inSection(57);
508 actualmatch = string.match(pattern);
509 expectedmatch = Array('ef', '');
512 status = inSection(58);
515 actualmatch = string.match(pattern);
516 expectedmatch = Array('a(b');
519 status = inSection(59);
522 actualmatch = string.match(pattern);
523 expectedmatch = Array('ab');
526 status = inSection(60);
529 actualmatch = string.match(pattern);
530 expectedmatch = Array('a((b');
533 status = inSection(61);
536 actualmatch = string.match(pattern);
537 expectedmatch = Array('a\\b');
540 status = inSection(62);
543 actualmatch = string.match(pattern);
544 expectedmatch = Array('a', 'a', 'a');
547 status = inSection(63);
550 actualmatch = string.match(pattern);
551 expectedmatch = Array('abc', 'a', 'c');
554 status = inSection(64);
557 actualmatch = string.match(pattern);
558 expectedmatch = Array('abc');
561 status = inSection(65);
562 pattern = /a{1,}b{1,}c/;
564 actualmatch = string.match(pattern);
565 expectedmatch = Array('abc');
568 status = inSection(66);
571 actualmatch = string.match(pattern);
572 expectedmatch = Array('abc');
575 status = inSection(67);
578 actualmatch = string.match(pattern);
579 expectedmatch = Array('ab', 'b');
582 status = inSection(68);
583 pattern = /(a+|b){0,}/;
585 actualmatch = string.match(pattern);
586 expectedmatch = Array('ab', 'b');
589 status = inSection(69);
592 actualmatch = string.match(pattern);
593 expectedmatch = Array('ab', 'b');
596 status = inSection(70);
597 pattern = /(a+|b){1,}/;
599 actualmatch = string.match(pattern);
600 expectedmatch = Array('ab', 'b');
603 status = inSection(71);
606 actualmatch = string.match(pattern);
607 expectedmatch = Array('a', 'a');
610 status = inSection(72);
611 pattern = /(a+|b){0,1}/;
613 actualmatch = string.match(pattern);
614 expectedmatch = Array('a', 'a');
617 status = inSection(73);
620 actualmatch = string.match(pattern);
621 expectedmatch = Array('cde');
624 status = inSection(74);
625 pattern = /([abc])*d/;
627 actualmatch = string.match(pattern);
628 expectedmatch = Array('abbbcd', 'c');
631 status = inSection(75);
632 pattern = /([abc])*bcd/;
634 actualmatch = string.match(pattern);
635 expectedmatch = Array('abcd', 'a');
638 status = inSection(76);
639 pattern = /a|b|c|d|e/;
641 actualmatch = string.match(pattern);
642 expectedmatch = Array('e');
645 status = inSection(77);
646 pattern = /(a|b|c|d|e)f/;
648 actualmatch = string.match(pattern);
649 expectedmatch = Array('ef', 'e');
652 status = inSection(78);
653 pattern = /abcd*efg/;
655 actualmatch = string.match(pattern);
656 expectedmatch = Array('abcdefg');
659 status = inSection(79);
661 string = 'xabyabbbz';
662 actualmatch = string.match(pattern);
663 expectedmatch = Array('ab');
666 status = inSection(80);
669 actualmatch = string.match(pattern);
670 expectedmatch = Array('a');
673 status = inSection(81);
674 pattern = /(ab|cd)e/;
676 actualmatch = string.match(pattern);
677 expectedmatch = Array('cde', 'cd');
680 status = inSection(82);
681 pattern = /[abhgefdc]ij/;
683 actualmatch = string.match(pattern);
684 expectedmatch = Array('hij');
687 status = inSection(83);
688 pattern = /(abc|)ef/;
690 actualmatch = string.match(pattern);
691 expectedmatch = Array('ef', '');
694 status = inSection(84);
695 pattern = /(a|b)c*d/;
697 actualmatch = string.match(pattern);
698 expectedmatch = Array('bcd', 'b');
701 status = inSection(85);
702 pattern = /(ab|ab*)bc/;
704 actualmatch = string.match(pattern);
705 expectedmatch = Array('abc', 'a');
708 status = inSection(86);
709 pattern = /a([bc]*)c*/;
711 actualmatch = string.match(pattern);
712 expectedmatch = Array('abc', 'bc');
715 status = inSection(87);
716 pattern = /a([bc]*)(c*d)/;
718 actualmatch = string.match(pattern);
719 expectedmatch = Array('abcd', 'bc', 'd');
722 status = inSection(88);
723 pattern = /a([bc]+)(c*d)/;
725 actualmatch = string.match(pattern);
726 expectedmatch = Array('abcd', 'bc', 'd');
729 status = inSection(89);
730 pattern = /a([bc]*)(c+d)/;
732 actualmatch = string.match(pattern);
733 expectedmatch = Array('abcd', 'b', 'cd');
736 status = inSection(90);
737 pattern = /a[bcd]*dcdcde/;
739 actualmatch = string.match(pattern);
740 expectedmatch = Array('adcdcde');
743 status = inSection(91);
744 pattern = /(ab|a)b*c/;
746 actualmatch = string.match(pattern);
747 expectedmatch = Array('abc', 'ab');
750 status = inSection(92);
751 pattern = /((a)(b)c)(d)/;
753 actualmatch = string.match(pattern);
754 expectedmatch = Array('abcd', 'abc', 'a', 'b', 'd');
757 status = inSection(93);
758 pattern = /[a-zA-Z_][a-zA-Z0-9_]*/;
760 actualmatch = string.match(pattern);
761 expectedmatch = Array('alpha');
764 status = inSection(94);
765 pattern = /^a(bc+|b[eh])g|.h$/;
767 actualmatch = string.match(pattern);
768 expectedmatch = Array('bh', undefined);
771 status = inSection(95);
772 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
774 actualmatch = string.match(pattern);
775 expectedmatch = Array('effgz', 'effgz', undefined);
778 status = inSection(96);
779 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
781 actualmatch = string.match(pattern);
782 expectedmatch = Array('ij', 'ij', 'j');
785 status = inSection(97);
786 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
788 actualmatch = string.match(pattern);
789 expectedmatch = Array('effgz', 'effgz', undefined);
792 status = inSection(98);
793 pattern = /((((((((((a))))))))))/;
795 actualmatch = string.match(pattern);
796 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
799 status = inSection(99);
800 pattern = /((((((((((a))))))))))\10/;
802 actualmatch = string.match(pattern);
803 expectedmatch = Array('aa', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
806 status = inSection(100);
807 pattern = /((((((((((a))))))))))/;
809 actualmatch = string.match(pattern);
810 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
813 status = inSection(101);
814 pattern = /(((((((((a)))))))))/;
816 actualmatch = string.match(pattern);
817 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
820 status = inSection(102);
821 pattern = /(.*)c(.*)/;
823 actualmatch = string.match(pattern);
824 expectedmatch = Array('abcde', 'ab', 'de');
827 status = inSection(103);
830 actualmatch = string.match(pattern);
831 expectedmatch = Array('abcd');
834 status = inSection(104);
837 actualmatch = string.match(pattern);
838 expectedmatch = Array('abcd', 'bc');
841 status = inSection(105);
844 actualmatch = string.match(pattern);
845 expectedmatch = Array('ac');
848 status = inSection(106);
851 actualmatch = string.match(pattern);
852 expectedmatch = Array('abcabc', 'abc');
855 status = inSection(107);
856 pattern = /([a-c]*)\1/;
858 actualmatch = string.match(pattern);
859 expectedmatch = Array('abcabc', 'abc');
862 status = inSection(108);
865 actualmatch = string.match(pattern);
866 expectedmatch = Array('a', 'a');
869 status = inSection(109);
870 pattern = /(([a-c])b*?\2)*/;
871 string = 'ababbbcbc';
872 actualmatch = string.match(pattern);
873 expectedmatch = Array('ababb', 'bb', 'b');
876 status = inSection(110);
877 pattern = /(([a-c])b*?\2){3}/;
878 string = 'ababbbcbc';
879 actualmatch = string.match(pattern);
880 expectedmatch = Array('ababbbcbc', 'cbc', 'c');
883 /* Can't refer to a capture before it's encountered & completed
884 status = inSection(111);
885 pattern = /((\3|b)\2(a)x)+/;
886 string = 'aaaxabaxbaaxbbax';
887 actualmatch = string.match(pattern);
888 expectedmatch = Array('bbax', 'bbax', 'b', 'a');
891 status = inSection(112);
892 pattern = /((\3|b)\2(a)){2,}/;
893 string = 'bbaababbabaaaaabbaaaabba';
894 actualmatch = string.match(pattern);
895 expectedmatch = Array('bbaaaabba', 'bba', 'b', 'a');
899 status = inSection(113);
902 actualmatch = string.match(pattern);
903 expectedmatch = Array('ABC');
906 status = inSection(114);
909 actualmatch = string.match(pattern);
910 expectedmatch = Array('ABC');
913 status = inSection(115);
916 actualmatch = string.match(pattern);
917 expectedmatch = Array('ABC');
920 status = inSection(116);
923 actualmatch = string.match(pattern);
924 expectedmatch = Array('ABC');
927 status = inSection(117);
930 actualmatch = string.match(pattern);
931 expectedmatch = Array('ABC');
934 status = inSection(118);
937 actualmatch = string.match(pattern);
938 expectedmatch = Array('ABBC');
941 status = inSection(119);
944 actualmatch = string.match(pattern);
945 expectedmatch = Array('ABBBBC');
948 status = inSection(120);
949 pattern = /ab{0,}?bc/i;
951 actualmatch = string.match(pattern);
952 expectedmatch = Array('ABBBBC');
955 status = inSection(121);
958 actualmatch = string.match(pattern);
959 expectedmatch = Array('ABBC');
962 status = inSection(122);
965 actualmatch = string.match(pattern);
966 expectedmatch = Array('ABBBBC');
969 status = inSection(123);
970 pattern = /ab{1,}?bc/i;
972 actualmatch = string.match(pattern);
973 expectedmatch = Array('ABBBBC');
976 status = inSection(124);
977 pattern = /ab{1,3}?bc/i;
979 actualmatch = string.match(pattern);
980 expectedmatch = Array('ABBBBC');
983 status = inSection(125);
984 pattern = /ab{3,4}?bc/i;
986 actualmatch = string.match(pattern);
987 expectedmatch = Array('ABBBBC');
990 status = inSection(126);
993 actualmatch = string.match(pattern);
994 expectedmatch = Array('ABBC');
997 status = inSection(127);
1000 actualmatch = string.match(pattern);
1001 expectedmatch = Array('ABC');
1004 status = inSection(128);
1005 pattern = /ab{0,1}?bc/i;
1007 actualmatch = string.match(pattern);
1008 expectedmatch = Array('ABC');
1011 status = inSection(129);
1014 actualmatch = string.match(pattern);
1015 expectedmatch = Array('ABC');
1018 status = inSection(130);
1019 pattern = /ab{0,1}?c/i;
1021 actualmatch = string.match(pattern);
1022 expectedmatch = Array('ABC');
1025 status = inSection(131);
1028 actualmatch = string.match(pattern);
1029 expectedmatch = Array('ABC');
1032 status = inSection(132);
1035 actualmatch = string.match(pattern);
1036 expectedmatch = Array('ABC');
1039 status = inSection(133);
1042 actualmatch = string.match(pattern);
1043 expectedmatch = Array('ABC');
1046 status = inSection(134);
1049 actualmatch = string.match(pattern);
1050 expectedmatch = Array('');
1053 status = inSection(135);
1056 actualmatch = string.match(pattern);
1057 expectedmatch = Array('');
1060 status = inSection(136);
1063 actualmatch = string.match(pattern);
1064 expectedmatch = Array('ABC');
1067 status = inSection(137);
1070 actualmatch = string.match(pattern);
1071 expectedmatch = Array('AXC');
1074 status = inSection(138);
1077 actualmatch = string.match(pattern);
1078 expectedmatch = Array('AXYZC');
1081 status = inSection(139);
1082 pattern = /a[bc]d/i;
1084 actualmatch = string.match(pattern);
1085 expectedmatch = Array('ABD');
1088 status = inSection(140);
1089 pattern = /a[b-d]e/i;
1091 actualmatch = string.match(pattern);
1092 expectedmatch = Array('ACE');
1095 status = inSection(141);
1096 pattern = /a[b-d]/i;
1098 actualmatch = string.match(pattern);
1099 expectedmatch = Array('AC');
1102 status = inSection(142);
1105 actualmatch = string.match(pattern);
1106 expectedmatch = Array('A-');
1109 status = inSection(143);
1112 actualmatch = string.match(pattern);
1113 expectedmatch = Array('A-');
1116 status = inSection(144);
1119 actualmatch = string.match(pattern);
1120 expectedmatch = Array('A]');
1123 /* Perl supports ] & ^] inside a [], ECMA does not
1124 status = inSection(145);
1127 actualmatch = string.match(pattern);
1128 expectedmatch = Array('A]B');
1132 status = inSection(146);
1133 pattern = /a[^bc]d/i;
1135 actualmatch = string.match(pattern);
1136 expectedmatch = Array('AED');
1139 status = inSection(147);
1140 pattern = /a[^-b]c/i;
1142 actualmatch = string.match(pattern);
1143 expectedmatch = Array('ADC');
1146 /* Perl supports ] & ^] inside a [], ECMA does not
1147 status = inSection(148);
1148 pattern = /a[^]b]c/i;
1150 actualmatch = string.match(pattern);
1151 expectedmatch = Array('ADC');
1155 status = inSection(149);
1158 actualmatch = string.match(pattern);
1159 expectedmatch = Array('AB');
1162 status = inSection(150);
1165 actualmatch = string.match(pattern);
1166 expectedmatch = Array('AB');
1169 status = inSection(151);
1172 actualmatch = string.match(pattern);
1173 expectedmatch = Array('EF', '');
1176 status = inSection(152);
1179 actualmatch = string.match(pattern);
1180 expectedmatch = Array('A(B');
1183 status = inSection(153);
1186 actualmatch = string.match(pattern);
1187 expectedmatch = Array('AB');
1190 status = inSection(154);
1193 actualmatch = string.match(pattern);
1194 expectedmatch = Array('A((B');
1197 status = inSection(155);
1200 actualmatch = string.match(pattern);
1201 expectedmatch = Array('A\\B');
1204 status = inSection(156);
1207 actualmatch = string.match(pattern);
1208 expectedmatch = Array('A', 'A', 'A');
1211 status = inSection(157);
1212 pattern = /(a)b(c)/i;
1214 actualmatch = string.match(pattern);
1215 expectedmatch = Array('ABC', 'A', 'C');
1218 status = inSection(158);
1221 actualmatch = string.match(pattern);
1222 expectedmatch = Array('ABC');
1225 status = inSection(159);
1226 pattern = /a{1,}b{1,}c/i;
1228 actualmatch = string.match(pattern);
1229 expectedmatch = Array('ABC');
1232 status = inSection(160);
1235 actualmatch = string.match(pattern);
1236 expectedmatch = Array('ABC');
1239 status = inSection(161);
1242 actualmatch = string.match(pattern);
1243 expectedmatch = Array('ABC');
1246 status = inSection(162);
1247 pattern = /a.{0,5}?c/i;
1249 actualmatch = string.match(pattern);
1250 expectedmatch = Array('ABC');
1253 status = inSection(163);
1254 pattern = /(a+|b)*/i;
1256 actualmatch = string.match(pattern);
1257 expectedmatch = Array('AB', 'B');
1260 status = inSection(164);
1261 pattern = /(a+|b){0,}/i;
1263 actualmatch = string.match(pattern);
1264 expectedmatch = Array('AB', 'B');
1267 status = inSection(165);
1268 pattern = /(a+|b)+/i;
1270 actualmatch = string.match(pattern);
1271 expectedmatch = Array('AB', 'B');
1274 status = inSection(166);
1275 pattern = /(a+|b){1,}/i;
1277 actualmatch = string.match(pattern);
1278 expectedmatch = Array('AB', 'B');
1281 status = inSection(167);
1282 pattern = /(a+|b)?/i;
1284 actualmatch = string.match(pattern);
1285 expectedmatch = Array('A', 'A');
1288 status = inSection(168);
1289 pattern = /(a+|b){0,1}/i;
1291 actualmatch = string.match(pattern);
1292 expectedmatch = Array('A', 'A');
1295 status = inSection(169);
1296 pattern = /(a+|b){0,1}?/i;
1298 actualmatch = string.match(pattern);
1299 expectedmatch = Array('', undefined);
1302 status = inSection(170);
1303 pattern = /[^ab]*/i;
1305 actualmatch = string.match(pattern);
1306 expectedmatch = Array('CDE');
1309 status = inSection(171);
1310 pattern = /([abc])*d/i;
1312 actualmatch = string.match(pattern);
1313 expectedmatch = Array('ABBBCD', 'C');
1316 status = inSection(172);
1317 pattern = /([abc])*bcd/i;
1319 actualmatch = string.match(pattern);
1320 expectedmatch = Array('ABCD', 'A');
1323 status = inSection(173);
1324 pattern = /a|b|c|d|e/i;
1326 actualmatch = string.match(pattern);
1327 expectedmatch = Array('E');
1330 status = inSection(174);
1331 pattern = /(a|b|c|d|e)f/i;
1333 actualmatch = string.match(pattern);
1334 expectedmatch = Array('EF', 'E');
1337 status = inSection(175);
1338 pattern = /abcd*efg/i;
1340 actualmatch = string.match(pattern);
1341 expectedmatch = Array('ABCDEFG');
1344 status = inSection(176);
1346 string = 'XABYABBBZ';
1347 actualmatch = string.match(pattern);
1348 expectedmatch = Array('AB');
1351 status = inSection(177);
1353 string = 'XAYABBBZ';
1354 actualmatch = string.match(pattern);
1355 expectedmatch = Array('A');
1358 status = inSection(178);
1359 pattern = /(ab|cd)e/i;
1361 actualmatch = string.match(pattern);
1362 expectedmatch = Array('CDE', 'CD');
1365 status = inSection(179);
1366 pattern = /[abhgefdc]ij/i;
1368 actualmatch = string.match(pattern);
1369 expectedmatch = Array('HIJ');
1372 status = inSection(180);
1373 pattern = /(abc|)ef/i;
1375 actualmatch = string.match(pattern);
1376 expectedmatch = Array('EF', '');
1379 status = inSection(181);
1380 pattern = /(a|b)c*d/i;
1382 actualmatch = string.match(pattern);
1383 expectedmatch = Array('BCD', 'B');
1386 status = inSection(182);
1387 pattern = /(ab|ab*)bc/i;
1389 actualmatch = string.match(pattern);
1390 expectedmatch = Array('ABC', 'A');
1393 status = inSection(183);
1394 pattern = /a([bc]*)c*/i;
1396 actualmatch = string.match(pattern);
1397 expectedmatch = Array('ABC', 'BC');
1400 status = inSection(184);
1401 pattern = /a([bc]*)(c*d)/i;
1403 actualmatch = string.match(pattern);
1404 expectedmatch = Array('ABCD', 'BC', 'D');
1407 status = inSection(185);
1408 pattern = /a([bc]+)(c*d)/i;
1410 actualmatch = string.match(pattern);
1411 expectedmatch = Array('ABCD', 'BC', 'D');
1414 status = inSection(186);
1415 pattern = /a([bc]*)(c+d)/i;
1417 actualmatch = string.match(pattern);
1418 expectedmatch = Array('ABCD', 'B', 'CD');
1421 status = inSection(187);
1422 pattern = /a[bcd]*dcdcde/i;
1424 actualmatch = string.match(pattern);
1425 expectedmatch = Array('ADCDCDE');
1428 status = inSection(188);
1429 pattern = /(ab|a)b*c/i;
1431 actualmatch = string.match(pattern);
1432 expectedmatch = Array('ABC', 'AB');
1435 status = inSection(189);
1436 pattern = /((a)(b)c)(d)/i;
1438 actualmatch = string.match(pattern);
1439 expectedmatch = Array('ABCD', 'ABC', 'A', 'B', 'D');
1442 status = inSection(190);
1443 pattern = /[a-zA-Z_][a-zA-Z0-9_]*/i;
1445 actualmatch = string.match(pattern);
1446 expectedmatch = Array('ALPHA');
1449 status = inSection(191);
1450 pattern = /^a(bc+|b[eh])g|.h$/i;
1452 actualmatch = string.match(pattern);
1453 expectedmatch = Array('BH', undefined);
1456 status = inSection(192);
1457 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1459 actualmatch = string.match(pattern);
1460 expectedmatch = Array('EFFGZ', 'EFFGZ', undefined);
1463 status = inSection(193);
1464 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1466 actualmatch = string.match(pattern);
1467 expectedmatch = Array('IJ', 'IJ', 'J');
1470 status = inSection(194);
1471 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1473 actualmatch = string.match(pattern);
1474 expectedmatch = Array('EFFGZ', 'EFFGZ', undefined);
1477 status = inSection(195);
1478 pattern = /((((((((((a))))))))))/i;
1480 actualmatch = string.match(pattern);
1481 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1484 status = inSection(196);
1485 pattern = /((((((((((a))))))))))\10/i;
1487 actualmatch = string.match(pattern);
1488 expectedmatch = Array('AA', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1491 status = inSection(197);
1492 pattern = /((((((((((a))))))))))/i;
1494 actualmatch = string.match(pattern);
1495 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1498 status = inSection(198);
1499 pattern = /(((((((((a)))))))))/i;
1501 actualmatch = string.match(pattern);
1502 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1505 status = inSection(199);
1506 pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i;
1508 actualmatch = string.match(pattern);
1509 expectedmatch = Array('A', 'A');
1512 status = inSection(200);
1513 pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i;
1515 actualmatch = string.match(pattern);
1516 expectedmatch = Array('C', 'C');
1519 status = inSection(201);
1520 pattern = /(.*)c(.*)/i;
1522 actualmatch = string.match(pattern);
1523 expectedmatch = Array('ABCDE', 'AB', 'DE');
1526 status = inSection(202);
1529 actualmatch = string.match(pattern);
1530 expectedmatch = Array('ABCD');
1533 status = inSection(203);
1534 pattern = /a(bc)d/i;
1536 actualmatch = string.match(pattern);
1537 expectedmatch = Array('ABCD', 'BC');
1540 status = inSection(204);
1541 pattern = /a[-]?c/i;
1543 actualmatch = string.match(pattern);
1544 expectedmatch = Array('AC');
1547 status = inSection(205);
1548 pattern = /(abc)\1/i;
1550 actualmatch = string.match(pattern);
1551 expectedmatch = Array('ABCABC', 'ABC');
1554 status = inSection(206);
1555 pattern = /([a-c]*)\1/i;
1557 actualmatch = string.match(pattern);
1558 expectedmatch = Array('ABCABC', 'ABC');
1561 status = inSection(207);
1562 pattern = /a(?!b)./;
1564 actualmatch = string.match(pattern);
1565 expectedmatch = Array('ad');
1568 status = inSection(208);
1569 pattern = /a(?=d)./;
1571 actualmatch = string.match(pattern);
1572 expectedmatch = Array('ad');
1575 status = inSection(209);
1576 pattern = /a(?=c|d)./;
1578 actualmatch = string.match(pattern);
1579 expectedmatch = Array('ad');
1582 status = inSection(210);
1583 pattern = /a(?:b|c|d)(.)/;
1585 actualmatch = string.match(pattern);
1586 expectedmatch = Array('ace', 'e');
1589 status = inSection(211);
1590 pattern = /a(?:b|c|d)*(.)/;
1592 actualmatch = string.match(pattern);
1593 expectedmatch = Array('ace', 'e');
1596 status = inSection(212);
1597 pattern = /a(?:b|c|d)+?(.)/;
1599 actualmatch = string.match(pattern);
1600 expectedmatch = Array('ace', 'e');
1603 status = inSection(213);
1604 pattern = /a(?:b|c|d)+?(.)/;
1605 string = 'acdbcdbe';
1606 actualmatch = string.match(pattern);
1607 expectedmatch = Array('acd', 'd');
1610 status = inSection(214);
1611 pattern = /a(?:b|c|d)+(.)/;
1612 string = 'acdbcdbe';
1613 actualmatch = string.match(pattern);
1614 expectedmatch = Array('acdbcdbe', 'e');
1617 status = inSection(215);
1618 pattern = /a(?:b|c|d){2}(.)/;
1619 string = 'acdbcdbe';
1620 actualmatch = string.match(pattern);
1621 expectedmatch = Array('acdb', 'b');
1624 status = inSection(216);
1625 pattern = /a(?:b|c|d){4,5}(.)/;
1626 string = 'acdbcdbe';
1627 actualmatch = string.match(pattern);
1628 expectedmatch = Array('acdbcdb', 'b');
1631 status = inSection(217);
1632 pattern = /a(?:b|c|d){4,5}?(.)/;
1633 string = 'acdbcdbe';
1634 actualmatch = string.match(pattern);
1635 expectedmatch = Array('acdbcd', 'd');
1638 // MODIFIED - ECMA has different rules for paren contents
1639 status = inSection(218);
1640 pattern = /((foo)|(bar))*/;
1642 actualmatch = string.match(pattern);
1643 //expectedmatch = Array('foobar', 'bar', 'foo', 'bar');
1644 expectedmatch = Array('foobar', 'bar', undefined, 'bar');
1647 status = inSection(219);
1648 pattern = /a(?:b|c|d){6,7}(.)/;
1649 string = 'acdbcdbe';
1650 actualmatch = string.match(pattern);
1651 expectedmatch = Array('acdbcdbe', 'e');
1654 status = inSection(220);
1655 pattern = /a(?:b|c|d){6,7}?(.)/;
1656 string = 'acdbcdbe';
1657 actualmatch = string.match(pattern);
1658 expectedmatch = Array('acdbcdbe', 'e');
1661 status = inSection(221);
1662 pattern = /a(?:b|c|d){5,6}(.)/;
1663 string = 'acdbcdbe';
1664 actualmatch = string.match(pattern);
1665 expectedmatch = Array('acdbcdbe', 'e');
1668 status = inSection(222);
1669 pattern = /a(?:b|c|d){5,6}?(.)/;
1670 string = 'acdbcdbe';
1671 actualmatch = string.match(pattern);
1672 expectedmatch = Array('acdbcdb', 'b');
1675 status = inSection(223);
1676 pattern = /a(?:b|c|d){5,7}(.)/;
1677 string = 'acdbcdbe';
1678 actualmatch = string.match(pattern);
1679 expectedmatch = Array('acdbcdbe', 'e');
1682 status = inSection(224);
1683 pattern = /a(?:b|c|d){5,7}?(.)/;
1684 string = 'acdbcdbe';
1685 actualmatch = string.match(pattern);
1686 expectedmatch = Array('acdbcdb', 'b');
1689 status = inSection(225);
1690 pattern = /a(?:b|(c|e){1,2}?|d)+?(.)/;
1692 actualmatch = string.match(pattern);
1693 expectedmatch = Array('ace', 'c', 'e');
1696 status = inSection(226);
1697 pattern = /^(.+)?B/;
1699 actualmatch = string.match(pattern);
1700 expectedmatch = Array('AB', 'A');
1703 /* MODIFIED - ECMA has different rules for paren contents */
1704 status = inSection(227);
1705 pattern = /^([^a-z])|(\^)$/;
1707 actualmatch = string.match(pattern);
1708 //expectedmatch = Array('.', '.', '');
1709 expectedmatch = Array('.', '.', undefined);
1712 status = inSection(228);
1715 actualmatch = string.match(pattern);
1716 expectedmatch = Array('<&');
1719 /* Can't refer to a capture before it's encountered & completed
1720 status = inSection(229);
1721 pattern = /^(a\1?){4}$/;
1722 string = 'aaaaaaaaaa';
1723 actualmatch = string.match(pattern);
1724 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1727 status = inSection(230);
1728 pattern = /^(a(?(1)\1)){4}$/;
1729 string = 'aaaaaaaaaa';
1730 actualmatch = string.match(pattern);
1731 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1735 status = inSection(231);
1736 pattern = /((a{4})+)/;
1737 string = 'aaaaaaaaa';
1738 actualmatch = string.match(pattern);
1739 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa');
1742 status = inSection(232);
1743 pattern = /(((aa){2})+)/;
1744 string = 'aaaaaaaaaa';
1745 actualmatch = string.match(pattern);
1746 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1749 status = inSection(233);
1750 pattern = /(((a{2}){2})+)/;
1751 string = 'aaaaaaaaaa';
1752 actualmatch = string.match(pattern);
1753 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1756 status = inSection(234);
1757 pattern = /(?:(f)(o)(o)|(b)(a)(r))*/;
1759 actualmatch = string.match(pattern);
1760 //expectedmatch = Array('foobar', 'f', 'o', 'o', 'b', 'a', 'r');
1761 expectedmatch = Array('foobar', undefined, undefined, undefined, 'b', 'a', 'r');
1764 /* ECMA supports (?: (?= and (?! but doesn't support (?< etc.
1765 status = inSection(235);
1766 pattern = /(?<=a)b/;
1768 actualmatch = string.match(pattern);
1769 expectedmatch = Array('b');
1772 status = inSection(236);
1773 pattern = /(?<!c)b/;
1775 actualmatch = string.match(pattern);
1776 expectedmatch = Array('b');
1779 status = inSection(237);
1780 pattern = /(?<!c)b/;
1782 actualmatch = string.match(pattern);
1783 expectedmatch = Array('b');
1786 status = inSection(238);
1787 pattern = /(?<!c)b/;
1789 actualmatch = string.match(pattern);
1790 expectedmatch = Array('b');
1794 status = inSection(239);
1795 pattern = /(?:..)*a/;
1797 actualmatch = string.match(pattern);
1798 expectedmatch = Array('aba');
1801 status = inSection(240);
1802 pattern = /(?:..)*?a/;
1804 actualmatch = string.match(pattern);
1805 expectedmatch = Array('a');
1809 * MODIFIED - ECMA has different rules for paren contents. Note
1810 * this regexp has two non-capturing parens, and one capturing
1812 * The issue: shouldn't the match be ['ab', undefined]? Because the
1813 * '\1' matches the undefined value of the second iteration of the '*'
1814 * (in which the 'b' part of the '|' matches). But Perl wants ['ab','b'].
1816 * Answer: waldemar@netscape.com:
1818 * The correct answer is ['ab', undefined]. Perl doesn't match
1819 * ECMAScript here, and I'd say that Perl is wrong in this case.
1821 status = inSection(241);
1822 pattern = /^(?:b|a(?=(.)))*\1/;
1824 actualmatch = string.match(pattern);
1825 //expectedmatch = Array('ab', 'b');
1826 expectedmatch = Array('ab', undefined);
1829 status = inSection(242);
1830 pattern = /^(){3,5}/;
1832 actualmatch = string.match(pattern);
1833 expectedmatch = Array('', '');
1836 status = inSection(243);
1837 pattern = /^(a+)*ax/;
1839 actualmatch = string.match(pattern);
1840 expectedmatch = Array('aax', 'a');
1843 status = inSection(244);
1844 pattern = /^((a|b)+)*ax/;
1846 actualmatch = string.match(pattern);
1847 expectedmatch = Array('aax', 'a', 'a');
1850 status = inSection(245);
1851 pattern = /^((a|bc)+)*ax/;
1853 actualmatch = string.match(pattern);
1854 expectedmatch = Array('aax', 'a', 'a');
1857 /* MODIFIED - ECMA has different rules for paren contents */
1858 status = inSection(246);
1859 pattern = /(a|x)*ab/;
1861 actualmatch = string.match(pattern);
1862 //expectedmatch = Array('ab', '');
1863 expectedmatch = Array('ab', undefined);
1866 status = inSection(247);
1869 actualmatch = string.match(pattern);
1870 expectedmatch = Array('ab', undefined);
1873 /* ECMA doesn't support (?imsx or (?-imsx
1874 status = inSection(248);
1875 pattern = /(?:(?i)a)b/;
1877 actualmatch = string.match(pattern);
1878 expectedmatch = Array('ab');
1881 status = inSection(249);
1882 pattern = /((?i)a)b/;
1884 actualmatch = string.match(pattern);
1885 expectedmatch = Array('ab', 'a');
1888 status = inSection(250);
1889 pattern = /(?:(?i)a)b/;
1891 actualmatch = string.match(pattern);
1892 expectedmatch = Array('Ab');
1895 status = inSection(251);
1896 pattern = /((?i)a)b/;
1898 actualmatch = string.match(pattern);
1899 expectedmatch = Array('Ab', 'A');
1902 status = inSection(252);
1903 pattern = /(?i:a)b/;
1905 actualmatch = string.match(pattern);
1906 expectedmatch = Array('ab');
1909 status = inSection(253);
1910 pattern = /((?i:a))b/;
1912 actualmatch = string.match(pattern);
1913 expectedmatch = Array('ab', 'a');
1916 status = inSection(254);
1917 pattern = /(?i:a)b/;
1919 actualmatch = string.match(pattern);
1920 expectedmatch = Array('Ab');
1923 status = inSection(255);
1924 pattern = /((?i:a))b/;
1926 actualmatch = string.match(pattern);
1927 expectedmatch = Array('Ab', 'A');
1930 status = inSection(256);
1931 pattern = /(?:(?-i)a)b/i;
1933 actualmatch = string.match(pattern);
1934 expectedmatch = Array('ab');
1937 status = inSection(257);
1938 pattern = /((?-i)a)b/i;
1940 actualmatch = string.match(pattern);
1941 expectedmatch = Array('ab', 'a');
1944 status = inSection(258);
1945 pattern = /(?:(?-i)a)b/i;
1947 actualmatch = string.match(pattern);
1948 expectedmatch = Array('aB');
1951 status = inSection(259);
1952 pattern = /((?-i)a)b/i;
1954 actualmatch = string.match(pattern);
1955 expectedmatch = Array('aB', 'a');
1958 status = inSection(260);
1959 pattern = /(?:(?-i)a)b/i;
1961 actualmatch = string.match(pattern);
1962 expectedmatch = Array('aB');
1965 status = inSection(261);
1966 pattern = /((?-i)a)b/i;
1968 actualmatch = string.match(pattern);
1969 expectedmatch = Array('aB', 'a');
1972 status = inSection(262);
1973 pattern = /(?-i:a)b/i;
1975 actualmatch = string.match(pattern);
1976 expectedmatch = Array('ab');
1979 status = inSection(263);
1980 pattern = /((?-i:a))b/i;
1982 actualmatch = string.match(pattern);
1983 expectedmatch = Array('ab', 'a');
1986 status = inSection(264);
1987 pattern = /(?-i:a)b/i;
1989 actualmatch = string.match(pattern);
1990 expectedmatch = Array('aB');
1993 status = inSection(265);
1994 pattern = /((?-i:a))b/i;
1996 actualmatch = string.match(pattern);
1997 expectedmatch = Array('aB', 'a');
2000 status = inSection(266);
2001 pattern = /(?-i:a)b/i;
2003 actualmatch = string.match(pattern);
2004 expectedmatch = Array('aB');
2007 status = inSection(267);
2008 pattern = /((?-i:a))b/i;
2010 actualmatch = string.match(pattern);
2011 expectedmatch = Array('aB', 'a');
2014 status = inSection(268);
2015 pattern = /((?s-i:a.))b/i;
2017 actualmatch = string.match(pattern);
2018 expectedmatch = Array('a\nB', 'a\n');
2022 status = inSection(269);
2023 pattern = /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/;
2025 actualmatch = string.match(pattern);
2026 expectedmatch = Array('cabbbb');
2029 status = inSection(270);
2030 pattern = /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/;
2031 string = 'caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
2032 actualmatch = string.match(pattern);
2033 expectedmatch = Array('caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
2036 status = inSection(271);
2037 pattern = /(ab)\d\1/i;
2039 actualmatch = string.match(pattern);
2040 expectedmatch = Array('Ab4ab', 'Ab');
2043 status = inSection(272);
2044 pattern = /(ab)\d\1/i;
2046 actualmatch = string.match(pattern);
2047 expectedmatch = Array('ab4Ab', 'ab');
2050 status = inSection(273);
2051 pattern = /foo\w*\d{4}baz/;
2052 string = 'foobar1234baz';
2053 actualmatch = string.match(pattern);
2054 expectedmatch = Array('foobar1234baz');
2057 status = inSection(274);
2058 pattern = /x(~~)*(?:(?:F)?)?/;
2060 actualmatch = string.match(pattern);
2061 expectedmatch = Array('x~~', '~~');
2064 /* Perl supports (?# but JS doesn't
2065 status = inSection(275);
2066 pattern = /^a(?#xxx){3}c/;
2068 actualmatch = string.match(pattern);
2069 expectedmatch = Array('aaac');
2073 /* ECMA doesn't support (?< etc
2074 status = inSection(276);
2075 pattern = /(?<![cd])[ab]/;
2077 actualmatch = string.match(pattern);
2078 expectedmatch = Array('a');
2081 status = inSection(277);
2082 pattern = /(?<!(c|d))[ab]/;
2084 actualmatch = string.match(pattern);
2085 expectedmatch = Array('a');
2088 status = inSection(278);
2089 pattern = /(?<!cd)[ab]/;
2091 actualmatch = string.match(pattern);
2092 expectedmatch = Array('b');
2095 status = inSection(279);
2096 pattern = /((?s)^a(.))((?m)^b$)/;
2097 string = 'a\nb\nc\n';
2098 actualmatch = string.match(pattern);
2099 expectedmatch = Array('a\nb', 'a\n', '\n', 'b');
2102 status = inSection(280);
2103 pattern = /((?m)^b$)/;
2104 string = 'a\nb\nc\n';
2105 actualmatch = string.match(pattern);
2106 expectedmatch = Array('b', 'b');
2109 status = inSection(281);
2112 actualmatch = string.match(pattern);
2113 expectedmatch = Array('b');
2116 status = inSection(282);
2117 pattern = /(?m)^(b)/;
2119 actualmatch = string.match(pattern);
2120 expectedmatch = Array('b', 'b');
2123 status = inSection(283);
2124 pattern = /((?m)^b)/;
2126 actualmatch = string.match(pattern);
2127 expectedmatch = Array('b', 'b');
2130 status = inSection(284);
2131 pattern = /\n((?m)^b)/;
2133 actualmatch = string.match(pattern);
2134 expectedmatch = Array('\nb', 'b');
2137 status = inSection(285);
2138 pattern = /((?s).)c(?!.)/;
2139 string = 'a\nb\nc\n';
2140 actualmatch = string.match(pattern);
2141 expectedmatch = Array('\nc', '\n');
2144 status = inSection(286);
2145 pattern = /((?s).)c(?!.)/;
2146 string = 'a\nb\nc\n';
2147 actualmatch = string.match(pattern);
2148 expectedmatch = Array('\nc', '\n');
2151 status = inSection(287);
2152 pattern = /((?s)b.)c(?!.)/;
2153 string = 'a\nb\nc\n';
2154 actualmatch = string.match(pattern);
2155 expectedmatch = Array('b\nc', 'b\n');
2158 status = inSection(288);
2159 pattern = /((?s)b.)c(?!.)/;
2160 string = 'a\nb\nc\n';
2161 actualmatch = string.match(pattern);
2162 expectedmatch = Array('b\nc', 'b\n');
2165 status = inSection(289);
2166 pattern = /((?m)^b)/;
2167 string = 'a\nb\nc\n';
2168 actualmatch = string.match(pattern);
2169 expectedmatch = Array('b', 'b');
2173 /* ECMA doesn't support (?(condition)
2174 status = inSection(290);
2175 pattern = /(?(1)b|a)/;
2177 actualmatch = string.match(pattern);
2178 expectedmatch = Array('a');
2181 status = inSection(291);
2182 pattern = /(x)?(?(1)b|a)/;
2184 actualmatch = string.match(pattern);
2185 expectedmatch = Array('a');
2188 status = inSection(292);
2189 pattern = /()?(?(1)b|a)/;
2191 actualmatch = string.match(pattern);
2192 expectedmatch = Array('a');
2195 status = inSection(293);
2196 pattern = /()?(?(1)a|b)/;
2198 actualmatch = string.match(pattern);
2199 expectedmatch = Array('a');
2202 status = inSection(294);
2203 pattern = /^(\()?blah(?(1)(\)))$/;
2205 actualmatch = string.match(pattern);
2206 expectedmatch = Array('(blah)', '(', ')');
2209 status = inSection(295);
2210 pattern = /^(\()?blah(?(1)(\)))$/;
2212 actualmatch = string.match(pattern);
2213 expectedmatch = Array('blah');
2216 status = inSection(296);
2217 pattern = /^(\(+)?blah(?(1)(\)))$/;
2219 actualmatch = string.match(pattern);
2220 expectedmatch = Array('(blah)', '(', ')');
2223 status = inSection(297);
2224 pattern = /^(\(+)?blah(?(1)(\)))$/;
2226 actualmatch = string.match(pattern);
2227 expectedmatch = Array('blah');
2230 status = inSection(298);
2231 pattern = /(?(?!a)b|a)/;
2233 actualmatch = string.match(pattern);
2234 expectedmatch = Array('a');
2237 status = inSection(299);
2238 pattern = /(?(?=a)a|b)/;
2240 actualmatch = string.match(pattern);
2241 expectedmatch = Array('a');
2245 status = inSection(300);
2246 pattern = /(?=(a+?))(\1ab)/;
2248 actualmatch = string.match(pattern);
2249 expectedmatch = Array('aab', 'a', 'aab');
2252 status = inSection(301);
2253 pattern = /(\w+:)+/;
2255 actualmatch = string.match(pattern);
2256 expectedmatch = Array('one:', 'one:');
2259 /* ECMA doesn't support (?< etc
2260 status = inSection(302);
2261 pattern = /$(?<=^(a))/;
2263 actualmatch = string.match(pattern);
2264 expectedmatch = Array('', 'a');
2268 status = inSection(303);
2269 pattern = /(?=(a+?))(\1ab)/;
2271 actualmatch = string.match(pattern);
2272 expectedmatch = Array('aab', 'a', 'aab');
2275 /* MODIFIED - ECMA has different rules for paren contents */
2276 status = inSection(304);
2277 pattern = /([\w:]+::)?(\w+)$/;
2279 actualmatch = string.match(pattern);
2280 //expectedmatch = Array('abcd', '', 'abcd');
2281 expectedmatch = Array('abcd', undefined, 'abcd');
2284 status = inSection(305);
2285 pattern = /([\w:]+::)?(\w+)$/;
2286 string = 'xy:z:::abcd';
2287 actualmatch = string.match(pattern);
2288 expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2291 status = inSection(306);
2292 pattern = /^[^bcd]*(c+)/;
2294 actualmatch = string.match(pattern);
2295 expectedmatch = Array('aexyc', 'c');
2298 status = inSection(307);
2301 actualmatch = string.match(pattern);
2302 expectedmatch = Array('aab', 'aa');
2305 /* MODIFIED - ECMA has different rules for paren contents */
2306 status = inSection(308);
2307 pattern = /([\w:]+::)?(\w+)$/;
2309 actualmatch = string.match(pattern);
2310 //expectedmatch = Array('abcd', '', 'abcd');
2311 expectedmatch = Array('abcd', undefined, 'abcd');
2314 status = inSection(309);
2315 pattern = /([\w:]+::)?(\w+)$/;
2316 string = 'xy:z:::abcd';
2317 actualmatch = string.match(pattern);
2318 expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2321 status = inSection(310);
2322 pattern = /^[^bcd]*(c+)/;
2324 actualmatch = string.match(pattern);
2325 expectedmatch = Array('aexyc', 'c');
2328 /* ECMA doesn't support (?>
2329 status = inSection(311);
2330 pattern = /(?>a+)b/;
2332 actualmatch = string.match(pattern);
2333 expectedmatch = Array('aaab');
2337 status = inSection(312);
2338 pattern = /([[:]+)/;
2340 actualmatch = string.match(pattern);
2341 expectedmatch = Array(':[', ':[');
2344 status = inSection(313);
2345 pattern = /([[=]+)/;
2347 actualmatch = string.match(pattern);
2348 expectedmatch = Array('=[', '=[');
2351 status = inSection(314);
2352 pattern = /([[.]+)/;
2354 actualmatch = string.match(pattern);
2355 expectedmatch = Array('.[', '.[');
2358 /* ECMA doesn't have rules for [:
2359 status = inSection(315);
2360 pattern = /[a[:]b[:c]/;
2362 actualmatch = string.match(pattern);
2363 expectedmatch = Array('abc');
2367 /* ECMA doesn't support (?>
2368 status = inSection(316);
2369 pattern = /((?>a+)b)/;
2371 actualmatch = string.match(pattern);
2372 expectedmatch = Array('aaab', 'aaab');
2375 status = inSection(317);
2376 pattern = /(?>(a+))b/;
2378 actualmatch = string.match(pattern);
2379 expectedmatch = Array('aaab', 'aaa');
2382 status = inSection(318);
2383 pattern = /((?>[^()]+)|\([^()]*\))+/;
2384 string = '((abc(ade)ufh()()x';
2385 actualmatch = string.match(pattern);
2386 expectedmatch = Array('abc(ade)ufh()()x', 'x');
2390 /* Perl has \Z has end-of-line, ECMA doesn't
2391 status = inSection(319);
2394 actualmatch = string.match(pattern);
2395 expectedmatch = Array('');
2398 status = inSection(320);
2401 actualmatch = string.match(pattern);
2402 expectedmatch = Array('');
2406 status = inSection(321);
2409 actualmatch = string.match(pattern);
2410 expectedmatch = Array('');
2413 /* Perl has \Z has end-of-line, ECMA doesn't
2414 status = inSection(322);
2417 actualmatch = string.match(pattern);
2418 expectedmatch = Array('');
2421 status = inSection(323);
2424 actualmatch = string.match(pattern);
2425 expectedmatch = Array('');
2429 status = inSection(324);
2432 actualmatch = string.match(pattern);
2433 expectedmatch = Array('');
2436 /* Perl has \Z has end-of-line, ECMA doesn't
2437 status = inSection(325);
2440 actualmatch = string.match(pattern);
2441 expectedmatch = Array('');
2444 status = inSection(326);
2447 actualmatch = string.match(pattern);
2448 expectedmatch = Array('');
2452 status = inSection(327);
2455 actualmatch = string.match(pattern);
2456 expectedmatch = Array('');
2459 /* Perl has \Z has end-of-line, ECMA doesn't
2460 status = inSection(328);
2463 actualmatch = string.match(pattern);
2464 expectedmatch = Array('');
2467 status = inSection(329);
2470 actualmatch = string.match(pattern);
2471 expectedmatch = Array('');
2475 status = inSection(330);
2478 actualmatch = string.match(pattern);
2479 expectedmatch = Array('');
2482 /* Perl has \Z has end-of-line, ECMA doesn't
2483 status = inSection(331);
2486 actualmatch = string.match(pattern);
2487 expectedmatch = Array('');
2490 status = inSection(332);
2493 actualmatch = string.match(pattern);
2494 expectedmatch = Array('');
2498 status = inSection(333);
2501 actualmatch = string.match(pattern);
2502 expectedmatch = Array('');
2505 /* Perl has \Z has end-of-line, ECMA doesn't
2506 status = inSection(334);
2509 actualmatch = string.match(pattern);
2510 expectedmatch = Array('');
2513 status = inSection(335);
2516 actualmatch = string.match(pattern);
2517 expectedmatch = Array('');
2521 status = inSection(336);
2524 actualmatch = string.match(pattern);
2525 expectedmatch = Array('');
2528 /* Perl has \Z has end-of-line, ECMA doesn't
2529 status = inSection(337);
2532 actualmatch = string.match(pattern);
2533 expectedmatch = Array('a');
2537 /* $ only matches end of input unless multiline
2538 status = inSection(338);
2541 actualmatch = string.match(pattern);
2542 expectedmatch = Array('a');
2546 /* Perl has \Z has end-of-line, ECMA doesn't
2547 status = inSection(339);
2550 actualmatch = string.match(pattern);
2551 expectedmatch = Array('a');
2554 status = inSection(340);
2557 actualmatch = string.match(pattern);
2558 expectedmatch = Array('a');
2562 status = inSection(341);
2565 actualmatch = string.match(pattern);
2566 expectedmatch = Array('a');
2569 status = inSection(342);
2572 actualmatch = string.match(pattern);
2573 expectedmatch = Array('a');
2576 /* Perl has \Z has end-of-line, ECMA doesn't
2577 status = inSection(343);
2580 actualmatch = string.match(pattern);
2581 expectedmatch = Array('a');
2585 status = inSection(344);
2588 actualmatch = string.match(pattern);
2589 expectedmatch = Array('a');
2592 /* Perl has \Z has end-of-line, ECMA doesn't
2593 status = inSection(345);
2596 actualmatch = string.match(pattern);
2597 expectedmatch = Array('a');
2600 status = inSection(346);
2603 actualmatch = string.match(pattern);
2604 expectedmatch = Array('a');
2608 status = inSection(347);
2611 actualmatch = string.match(pattern);
2612 expectedmatch = Array('a');
2615 /* Perl has \Z has end-of-line, ECMA doesn't
2616 status = inSection(348);
2619 actualmatch = string.match(pattern);
2620 expectedmatch = Array('aa');
2624 /* $ only matches end of input unless multiline
2625 status = inSection(349);
2628 actualmatch = string.match(pattern);
2629 expectedmatch = Array('aa');
2633 /* Perl has \Z has end-of-line, ECMA doesn't
2634 status = inSection(350);
2637 actualmatch = string.match(pattern);
2638 expectedmatch = Array('aa');
2641 status = inSection(351);
2644 actualmatch = string.match(pattern);
2645 expectedmatch = Array('aa');
2649 status = inSection(352);
2652 actualmatch = string.match(pattern);
2653 expectedmatch = Array('aa');
2656 status = inSection(353);
2659 actualmatch = string.match(pattern);
2660 expectedmatch = Array('aa');
2663 /* Perl has \Z has end-of-line, ECMA doesn't
2664 status = inSection(354);
2667 actualmatch = string.match(pattern);
2668 expectedmatch = Array('aa');
2672 status = inSection(355);
2675 actualmatch = string.match(pattern);
2676 expectedmatch = Array('aa');
2679 /* Perl has \Z has end-of-line, ECMA doesn't
2680 status = inSection(356);
2683 actualmatch = string.match(pattern);
2684 expectedmatch = Array('aa');
2687 status = inSection(357);
2690 actualmatch = string.match(pattern);
2691 expectedmatch = Array('aa');
2695 status = inSection(358);
2698 actualmatch = string.match(pattern);
2699 expectedmatch = Array('aa');
2702 /* Perl has \Z has end-of-line, ECMA doesn't
2703 status = inSection(359);
2706 actualmatch = string.match(pattern);
2707 expectedmatch = Array('ab');
2711 /* $ only matches end of input unless multiline
2712 status = inSection(360);
2715 actualmatch = string.match(pattern);
2716 expectedmatch = Array('ab');
2720 /* Perl has \Z has end-of-line, ECMA doesn't
2721 status = inSection(361);
2724 actualmatch = string.match(pattern);
2725 expectedmatch = Array('ab');
2728 status = inSection(362);
2731 actualmatch = string.match(pattern);
2732 expectedmatch = Array('ab');
2736 status = inSection(363);
2739 actualmatch = string.match(pattern);
2740 expectedmatch = Array('ab');
2743 status = inSection(364);
2746 actualmatch = string.match(pattern);
2747 expectedmatch = Array('ab');
2750 /* Perl has \Z has end-of-line, ECMA doesn't
2751 status = inSection(365);
2754 actualmatch = string.match(pattern);
2755 expectedmatch = Array('ab');
2759 status = inSection(366);
2762 actualmatch = string.match(pattern);
2763 expectedmatch = Array('ab');
2766 /* Perl has \Z has end-of-line, ECMA doesn't
2767 status = inSection(367);
2770 actualmatch = string.match(pattern);
2771 expectedmatch = Array('ab');
2774 status = inSection(368);
2777 actualmatch = string.match(pattern);
2778 expectedmatch = Array('ab');
2782 status = inSection(369);
2785 actualmatch = string.match(pattern);
2786 expectedmatch = Array('ab');
2789 /* Perl has \Z has end-of-line, ECMA doesn't
2790 status = inSection(370);
2792 string = 'b\nabb\n';
2793 actualmatch = string.match(pattern);
2794 expectedmatch = Array('abb');
2798 /* $ only matches end of input unless multiline
2799 status = inSection(371);
2801 string = 'b\nabb\n';
2802 actualmatch = string.match(pattern);
2803 expectedmatch = Array('abb');
2807 /* Perl has \Z has end-of-line, ECMA doesn't
2808 status = inSection(372);
2811 actualmatch = string.match(pattern);
2812 expectedmatch = Array('abb');
2815 status = inSection(373);
2818 actualmatch = string.match(pattern);
2819 expectedmatch = Array('abb');
2823 status = inSection(374);
2826 actualmatch = string.match(pattern);
2827 expectedmatch = Array('abb');
2830 status = inSection(375);
2832 string = 'abb\nb\n';
2833 actualmatch = string.match(pattern);
2834 expectedmatch = Array('abb');
2837 /* Perl has \Z has end-of-line, ECMA doesn't
2838 status = inSection(376);
2840 string = 'b\nabb\n';
2841 actualmatch = string.match(pattern);
2842 expectedmatch = Array('abb');
2846 status = inSection(377);
2848 string = 'b\nabb\n';
2849 actualmatch = string.match(pattern);
2850 expectedmatch = Array('abb');
2853 /* Perl has \Z has end-of-line, ECMA doesn't
2854 status = inSection(378);
2857 actualmatch = string.match(pattern);
2858 expectedmatch = Array('abb');
2861 status = inSection(379);
2864 actualmatch = string.match(pattern);
2865 expectedmatch = Array('abb');
2869 status = inSection(380);
2872 actualmatch = string.match(pattern);
2873 expectedmatch = Array('abb');
2876 status = inSection(381);
2877 pattern = /(^|x)(c)/;
2879 actualmatch = string.match(pattern);
2880 expectedmatch = Array('c', '', 'c');
2883 status = inSection(382);
2884 pattern = /foo.bart/;
2885 string = 'foo.bart';
2886 actualmatch = string.match(pattern);
2887 expectedmatch = Array('foo.bart');
2890 status = inSection(383);
2891 pattern = /^d[x][x][x]/m;
2892 string = 'abcd\ndxxx';
2893 actualmatch = string.match(pattern);
2894 expectedmatch = Array('dxxx');
2897 status = inSection(384);
2900 actualmatch = string.match(pattern);
2901 expectedmatch = Array('tt');
2904 /* ECMA spec says that each atom in a range must be a single character
2905 status = inSection(385);
2906 pattern = /([a-\d]+)/;
2908 actualmatch = string.match(pattern);
2909 expectedmatch = Array('9', '9');
2912 status = inSection(386);
2913 pattern = /([\d-z]+)/;
2915 actualmatch = string.match(pattern);
2916 expectedmatch = Array('0-z', '0-z');
2920 /* ECMA doesn't support [:
2921 status = inSection(387);
2922 pattern = /([a-[:digit:]]+)/;
2924 actualmatch = string.match(pattern);
2925 expectedmatch = Array('a-9', 'a-9');
2928 status = inSection(388);
2929 pattern = /([[:digit:]-z]+)/;
2931 actualmatch = string.match(pattern);
2932 expectedmatch = Array('0-z', '0-z');
2935 status = inSection(389);
2936 pattern = /([[:digit:]-[:alpha:]]+)/;
2938 actualmatch = string.match(pattern);
2939 expectedmatch = Array('0-z', '0-z');
2943 status = inSection(390);
2944 pattern = /(\d+\.\d+)/;
2945 string = '3.1415926';
2946 actualmatch = string.match(pattern);
2947 expectedmatch = Array('3.1415926', '3.1415926');
2950 status = inSection(391);
2951 pattern = /\.c(pp|xx|c)?$/i;
2953 actualmatch = string.match(pattern);
2954 expectedmatch = Array('.c', undefined);
2957 status = inSection(392);
2958 pattern = /(\.c(pp|xx|c)?$)/i;
2960 actualmatch = string.match(pattern);
2961 expectedmatch = Array('.c', '.c', undefined);
2964 status = inSection(393);
2967 actualmatch = string.match(pattern);
2968 expectedmatch = Array('ab', 'a');
2971 status = inSection(394);
2972 pattern = /^([ab]*?)(b)?(c)$/;
2974 actualmatch = string.match(pattern);
2975 expectedmatch = Array('abac', 'aba', undefined, 'c');
2978 status = inSection(395);
2979 pattern = /^(?:.,){2}c/i;
2981 actualmatch = string.match(pattern);
2982 expectedmatch = Array('a,b,c');
2985 status = inSection(396);
2986 pattern = /^(.,){2}c/i;
2988 actualmatch = string.match(pattern);
2989 expectedmatch = Array('a,b,c', 'b,');
2992 status = inSection(397);
2993 pattern = /^(?:[^,]*,){2}c/;
2995 actualmatch = string.match(pattern);
2996 expectedmatch = Array('a,b,c');
2999 status = inSection(398);
3000 pattern = /^([^,]*,){2}c/;
3002 actualmatch = string.match(pattern);
3003 expectedmatch = Array('a,b,c', 'b,');
3006 status = inSection(399);
3007 pattern = /^([^,]*,){3}d/;
3008 string = 'aaa,b,c,d';
3009 actualmatch = string.match(pattern);
3010 expectedmatch = Array('aaa,b,c,d', 'c,');
3013 status = inSection(400);
3014 pattern = /^([^,]*,){3,}d/;
3015 string = 'aaa,b,c,d';
3016 actualmatch = string.match(pattern);
3017 expectedmatch = Array('aaa,b,c,d', 'c,');
3020 status = inSection(401);
3021 pattern = /^([^,]*,){0,3}d/;
3022 string = 'aaa,b,c,d';
3023 actualmatch = string.match(pattern);
3024 expectedmatch = Array('aaa,b,c,d', 'c,');
3027 status = inSection(402);
3028 pattern = /^([^,]{1,3},){3}d/i;
3029 string = 'aaa,b,c,d';
3030 actualmatch = string.match(pattern);
3031 expectedmatch = Array('aaa,b,c,d', 'c,');
3034 status = inSection(403);
3035 pattern = /^([^,]{1,3},){3,}d/;
3036 string = 'aaa,b,c,d';
3037 actualmatch = string.match(pattern);
3038 expectedmatch = Array('aaa,b,c,d', 'c,');
3041 status = inSection(404);
3042 pattern = /^([^,]{1,3},){0,3}d/;
3043 string = 'aaa,b,c,d';
3044 actualmatch = string.match(pattern);
3045 expectedmatch = Array('aaa,b,c,d', 'c,');
3048 status = inSection(405);
3049 pattern = /^([^,]{1,},){3}d/;
3050 string = 'aaa,b,c,d';
3051 actualmatch = string.match(pattern);
3052 expectedmatch = Array('aaa,b,c,d', 'c,');
3055 status = inSection(406);
3056 pattern = /^([^,]{1,},){3,}d/;
3057 string = 'aaa,b,c,d';
3058 actualmatch = string.match(pattern);
3059 expectedmatch = Array('aaa,b,c,d', 'c,');
3062 status = inSection(407);
3063 pattern = /^([^,]{1,},){0,3}d/;
3064 string = 'aaa,b,c,d';
3065 actualmatch = string.match(pattern);
3066 expectedmatch = Array('aaa,b,c,d', 'c,');
3069 status = inSection(408);
3070 pattern = /^([^,]{0,3},){3}d/i;
3071 string = 'aaa,b,c,d';
3072 actualmatch = string.match(pattern);
3073 expectedmatch = Array('aaa,b,c,d', 'c,');
3076 status = inSection(409);
3077 pattern = /^([^,]{0,3},){3,}d/;
3078 string = 'aaa,b,c,d';
3079 actualmatch = string.match(pattern);
3080 expectedmatch = Array('aaa,b,c,d', 'c,');
3083 status = inSection(410);
3084 pattern = /^([^,]{0,3},){0,3}d/;
3085 string = 'aaa,b,c,d';
3086 actualmatch = string.match(pattern);
3087 expectedmatch = Array('aaa,b,c,d', 'c,');
3090 /* ECMA doesn't support \A
3091 status = inSection(411);
3092 pattern = /(?!\A)x/m;
3094 actualmatch = string.match(pattern);
3095 expectedmatch = Array('\n');
3099 status = inSection(412);
3100 pattern = /^(a(b)?)+$/;
3102 actualmatch = string.match(pattern);
3103 expectedmatch = Array('aba', 'a', undefined);
3106 status = inSection(413);
3107 pattern = /^(aa(bb)?)+$/;
3109 actualmatch = string.match(pattern);
3110 expectedmatch = Array('aabbaa', 'aa', undefined);
3113 status = inSection(414);
3114 pattern = /^.{9}abc.*\n/m;
3115 string = '123\nabcabcabcabc\n';
3116 actualmatch = string.match(pattern);
3117 expectedmatch = Array('abcabcabcabc\n');
3120 status = inSection(415);
3121 pattern = /^(a)?a$/;
3123 actualmatch = string.match(pattern);
3124 expectedmatch = Array('a', undefined);
3127 status = inSection(416);
3128 pattern = /^(a\1?)(a\1?)(a\2?)(a\3?)$/;
3130 actualmatch = string.match(pattern);
3131 expectedmatch = Array('aaaaaa', 'a', 'aa', 'a', 'aa');
3134 /* Can't refer to a capture before it's encountered & completed
3135 status = inSection(417);
3136 pattern = /^(a\1?){4}$/;
3138 actualmatch = string.match(pattern);
3139 expectedmatch = Array('aaaaaa', 'aaa');
3143 status = inSection(418);
3144 pattern = /^(0+)?(?:x(1))?/;
3146 actualmatch = string.match(pattern);
3147 expectedmatch = Array('x1', undefined, '1');
3150 status = inSection(419);
3151 pattern = /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/;
3152 string = '012cxx0190';
3153 actualmatch = string.match(pattern);
3154 expectedmatch = Array('012cxx0190', '012c', undefined, '0190');
3157 status = inSection(420);
3158 pattern = /^(b+?|a){1,2}c/;
3160 actualmatch = string.match(pattern);
3161 expectedmatch = Array('bbbac', 'a');
3164 status = inSection(421);
3165 pattern = /^(b+?|a){1,2}c/;
3167 actualmatch = string.match(pattern);
3168 expectedmatch = Array('bbbbac', 'a');
3171 status = inSection(422);
3172 pattern = /((?:aaaa|bbbb)cccc)?/;
3173 string = 'aaaacccc';
3174 actualmatch = string.match(pattern);
3175 expectedmatch = Array('aaaacccc', 'aaaacccc');
3178 status = inSection(423);
3179 pattern = /((?:aaaa|bbbb)cccc)?/;
3180 string = 'bbbbcccc';
3181 actualmatch = string.match(pattern);
3182 expectedmatch = Array('bbbbcccc', 'bbbbcccc');
3188 //-----------------------------------------------------------------------------
3190 //-----------------------------------------------------------------------------
3196 if(omitCurrentSection())
3199 statusmessages[i] = status;
3200 patterns[i] = pattern;
3201 strings[i] = string;
3202 actualmatches[i] = actualmatch;
3203 expectedmatches[i] = expectedmatch;
3208 function omitCurrentSection()
3212 // current section number is in global status variable
3213 var n = status.match(/(\d+)/)[1];
3214 return ((n < cnLBOUND) || (n > cnUBOUND));
3226 printBugNumber(BUGNUMBER);
3227 printStatus (summary);
3228 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);