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 //-----------------------------------------------------------------------------
91 var BUGNUMBER = 85721;
92 var summary = 'Testing regular expression edge cases';
93 var cnSingleSpace = ' ';
95 var statusmessages = new Array();
97 var patterns = new Array();
99 var strings = new Array();
100 var actualmatch = '';
101 var actualmatches = new Array();
102 var expectedmatch = '';
103 var expectedmatches = new Array();
108 status = inSection(1);
111 actualmatch = string.match(pattern);
112 expectedmatch = Array('abc');
115 status = inSection(2);
118 actualmatch = string.match(pattern);
119 expectedmatch = Array('abc');
122 status = inSection(3);
125 actualmatch = string.match(pattern);
126 expectedmatch = Array('abc');
129 status = inSection(4);
132 actualmatch = string.match(pattern);
133 expectedmatch = Array('abc');
136 status = inSection(5);
139 actualmatch = string.match(pattern);
140 expectedmatch = Array('abc');
143 status = inSection(6);
146 actualmatch = string.match(pattern);
147 expectedmatch = Array('abbc');
150 status = inSection(7);
153 actualmatch = string.match(pattern);
154 expectedmatch = Array('abbbbc');
157 status = inSection(8);
160 actualmatch = string.match(pattern);
161 expectedmatch = Array('a');
164 status = inSection(9);
167 actualmatch = string.match(pattern);
168 expectedmatch = Array('abbb');
171 status = inSection(10);
172 pattern = /ab{0,}bc/;
174 actualmatch = string.match(pattern);
175 expectedmatch = Array('abbbbc');
178 status = inSection(11);
181 actualmatch = string.match(pattern);
182 expectedmatch = Array('abbc');
185 status = inSection(12);
188 actualmatch = string.match(pattern);
189 expectedmatch = Array('abbbbc');
192 status = inSection(13);
193 pattern = /ab{1,}bc/;
195 actualmatch = string.match(pattern);
196 expectedmatch = Array('abbbbc');
199 status = inSection(14);
200 pattern = /ab{1,3}bc/;
202 actualmatch = string.match(pattern);
203 expectedmatch = Array('abbbbc');
206 status = inSection(15);
207 pattern = /ab{3,4}bc/;
209 actualmatch = string.match(pattern);
210 expectedmatch = Array('abbbbc');
213 status = inSection(16);
216 actualmatch = string.match(pattern);
217 expectedmatch = Array('abbc');
220 status = inSection(17);
223 actualmatch = string.match(pattern);
224 expectedmatch = Array('abc');
227 status = inSection(18);
228 pattern = /ab{0,1}bc/;
230 actualmatch = string.match(pattern);
231 expectedmatch = Array('abc');
234 status = inSection(19);
237 actualmatch = string.match(pattern);
238 expectedmatch = Array('abc');
241 status = inSection(20);
242 pattern = /ab{0,1}c/;
244 actualmatch = string.match(pattern);
245 expectedmatch = Array('abc');
248 status = inSection(21);
251 actualmatch = string.match(pattern);
252 expectedmatch = Array('abc');
255 status = inSection(22);
258 actualmatch = string.match(pattern);
259 expectedmatch = Array('abc');
262 status = inSection(23);
265 actualmatch = string.match(pattern);
266 expectedmatch = Array('abc');
269 status = inSection(24);
272 actualmatch = string.match(pattern);
273 expectedmatch = Array('');
276 status = inSection(25);
279 actualmatch = string.match(pattern);
280 expectedmatch = Array('');
283 status = inSection(26);
286 actualmatch = string.match(pattern);
287 expectedmatch = Array('abc');
290 status = inSection(27);
293 actualmatch = string.match(pattern);
294 expectedmatch = Array('axc');
297 status = inSection(28);
300 actualmatch = string.match(pattern);
301 expectedmatch = Array('axyzc');
304 status = inSection(29);
307 actualmatch = string.match(pattern);
308 expectedmatch = Array('abd');
311 status = inSection(30);
314 actualmatch = string.match(pattern);
315 expectedmatch = Array('ace');
318 status = inSection(31);
321 actualmatch = string.match(pattern);
322 expectedmatch = Array('ac');
325 status = inSection(32);
328 actualmatch = string.match(pattern);
329 expectedmatch = Array('a-');
332 status = inSection(33);
335 actualmatch = string.match(pattern);
336 expectedmatch = Array('a-');
339 status = inSection(34);
342 actualmatch = string.match(pattern);
343 expectedmatch = Array('a]');
346 /* Perl supports ] & ^] inside a [], ECMA does not
348 status = inSection(35);
350 actualmatch = string.match(pattern);
351 expectedmatch = Array('a]b');
355 status = inSection(36);
358 actualmatch = string.match(pattern);
359 expectedmatch = Array('aed');
362 status = inSection(37);
365 actualmatch = string.match(pattern);
366 expectedmatch = Array('adc');
369 /* Perl supports ] & ^] inside a [], ECMA does not
370 status = inSection(38);
373 actualmatch = string.match(pattern);
374 expectedmatch = Array('adc');
378 status = inSection(39);
381 actualmatch = string.match(pattern);
382 expectedmatch = Array('a');
385 status = inSection(40);
388 actualmatch = string.match(pattern);
389 expectedmatch = Array('a');
392 status = inSection(41);
395 actualmatch = string.match(pattern);
396 expectedmatch = Array('a');
399 status = inSection(42);
402 actualmatch = string.match(pattern);
403 expectedmatch = Array('y');
406 status = inSection(43);
409 actualmatch = string.match(pattern);
410 expectedmatch = Array('y');
413 status = inSection(44);
416 actualmatch = string.match(pattern);
417 expectedmatch = Array('y');
420 status = inSection(45);
423 actualmatch = string.match(pattern);
424 expectedmatch = Array('a');
427 status = inSection(46);
430 actualmatch = string.match(pattern);
431 expectedmatch = Array('-');
434 status = inSection(47);
437 actualmatch = string.match(pattern);
438 expectedmatch = Array('a-b');
441 status = inSection(48);
444 actualmatch = string.match(pattern);
445 expectedmatch = Array('1');
448 status = inSection(49);
451 actualmatch = string.match(pattern);
452 expectedmatch = Array('-');
455 status = inSection(50);
458 actualmatch = string.match(pattern);
459 expectedmatch = Array('a');
462 status = inSection(51);
465 actualmatch = string.match(pattern);
466 expectedmatch = Array('-');
469 status = inSection(52);
472 actualmatch = string.match(pattern);
473 expectedmatch = Array('a-b');
476 status = inSection(53);
479 actualmatch = string.match(pattern);
480 expectedmatch = Array('1');
483 status = inSection(54);
486 actualmatch = string.match(pattern);
487 expectedmatch = Array('-');
490 status = inSection(55);
493 actualmatch = string.match(pattern);
494 expectedmatch = Array('ab');
497 status = inSection(56);
500 actualmatch = string.match(pattern);
501 expectedmatch = Array('ab');
504 status = inSection(57);
507 actualmatch = string.match(pattern);
508 expectedmatch = Array('ef', '');
511 status = inSection(58);
514 actualmatch = string.match(pattern);
515 expectedmatch = Array('a(b');
518 status = inSection(59);
521 actualmatch = string.match(pattern);
522 expectedmatch = Array('ab');
525 status = inSection(60);
528 actualmatch = string.match(pattern);
529 expectedmatch = Array('a((b');
532 status = inSection(61);
535 actualmatch = string.match(pattern);
536 expectedmatch = Array('a\\b');
539 status = inSection(62);
542 actualmatch = string.match(pattern);
543 expectedmatch = Array('a', 'a', 'a');
546 status = inSection(63);
549 actualmatch = string.match(pattern);
550 expectedmatch = Array('abc', 'a', 'c');
553 status = inSection(64);
556 actualmatch = string.match(pattern);
557 expectedmatch = Array('abc');
560 status = inSection(65);
561 pattern = /a{1,}b{1,}c/;
563 actualmatch = string.match(pattern);
564 expectedmatch = Array('abc');
567 status = inSection(66);
570 actualmatch = string.match(pattern);
571 expectedmatch = Array('abc');
574 status = inSection(67);
577 actualmatch = string.match(pattern);
578 expectedmatch = Array('ab', 'b');
581 status = inSection(68);
582 pattern = /(a+|b){0,}/;
584 actualmatch = string.match(pattern);
585 expectedmatch = Array('ab', 'b');
588 status = inSection(69);
591 actualmatch = string.match(pattern);
592 expectedmatch = Array('ab', 'b');
595 status = inSection(70);
596 pattern = /(a+|b){1,}/;
598 actualmatch = string.match(pattern);
599 expectedmatch = Array('ab', 'b');
602 status = inSection(71);
605 actualmatch = string.match(pattern);
606 expectedmatch = Array('a', 'a');
609 status = inSection(72);
610 pattern = /(a+|b){0,1}/;
612 actualmatch = string.match(pattern);
613 expectedmatch = Array('a', 'a');
616 status = inSection(73);
619 actualmatch = string.match(pattern);
620 expectedmatch = Array('cde');
623 status = inSection(74);
624 pattern = /([abc])*d/;
626 actualmatch = string.match(pattern);
627 expectedmatch = Array('abbbcd', 'c');
630 status = inSection(75);
631 pattern = /([abc])*bcd/;
633 actualmatch = string.match(pattern);
634 expectedmatch = Array('abcd', 'a');
637 status = inSection(76);
638 pattern = /a|b|c|d|e/;
640 actualmatch = string.match(pattern);
641 expectedmatch = Array('e');
644 status = inSection(77);
645 pattern = /(a|b|c|d|e)f/;
647 actualmatch = string.match(pattern);
648 expectedmatch = Array('ef', 'e');
651 status = inSection(78);
652 pattern = /abcd*efg/;
654 actualmatch = string.match(pattern);
655 expectedmatch = Array('abcdefg');
658 status = inSection(79);
660 string = 'xabyabbbz';
661 actualmatch = string.match(pattern);
662 expectedmatch = Array('ab');
665 status = inSection(80);
668 actualmatch = string.match(pattern);
669 expectedmatch = Array('a');
672 status = inSection(81);
673 pattern = /(ab|cd)e/;
675 actualmatch = string.match(pattern);
676 expectedmatch = Array('cde', 'cd');
679 status = inSection(82);
680 pattern = /[abhgefdc]ij/;
682 actualmatch = string.match(pattern);
683 expectedmatch = Array('hij');
686 status = inSection(83);
687 pattern = /(abc|)ef/;
689 actualmatch = string.match(pattern);
690 expectedmatch = Array('ef', '');
693 status = inSection(84);
694 pattern = /(a|b)c*d/;
696 actualmatch = string.match(pattern);
697 expectedmatch = Array('bcd', 'b');
700 status = inSection(85);
701 pattern = /(ab|ab*)bc/;
703 actualmatch = string.match(pattern);
704 expectedmatch = Array('abc', 'a');
707 status = inSection(86);
708 pattern = /a([bc]*)c*/;
710 actualmatch = string.match(pattern);
711 expectedmatch = Array('abc', 'bc');
714 status = inSection(87);
715 pattern = /a([bc]*)(c*d)/;
717 actualmatch = string.match(pattern);
718 expectedmatch = Array('abcd', 'bc', 'd');
721 status = inSection(88);
722 pattern = /a([bc]+)(c*d)/;
724 actualmatch = string.match(pattern);
725 expectedmatch = Array('abcd', 'bc', 'd');
728 status = inSection(89);
729 pattern = /a([bc]*)(c+d)/;
731 actualmatch = string.match(pattern);
732 expectedmatch = Array('abcd', 'b', 'cd');
735 status = inSection(90);
736 pattern = /a[bcd]*dcdcde/;
738 actualmatch = string.match(pattern);
739 expectedmatch = Array('adcdcde');
742 status = inSection(91);
743 pattern = /(ab|a)b*c/;
745 actualmatch = string.match(pattern);
746 expectedmatch = Array('abc', 'ab');
749 status = inSection(92);
750 pattern = /((a)(b)c)(d)/;
752 actualmatch = string.match(pattern);
753 expectedmatch = Array('abcd', 'abc', 'a', 'b', 'd');
756 status = inSection(93);
757 pattern = /[a-zA-Z_][a-zA-Z0-9_]*/;
759 actualmatch = string.match(pattern);
760 expectedmatch = Array('alpha');
763 status = inSection(94);
764 pattern = /^a(bc+|b[eh])g|.h$/;
766 actualmatch = string.match(pattern);
767 expectedmatch = Array('bh', undefined);
770 status = inSection(95);
771 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
773 actualmatch = string.match(pattern);
774 expectedmatch = Array('effgz', 'effgz', undefined);
777 status = inSection(96);
778 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
780 actualmatch = string.match(pattern);
781 expectedmatch = Array('ij', 'ij', 'j');
784 status = inSection(97);
785 pattern = /(bc+d$|ef*g.|h?i(j|k))/;
787 actualmatch = string.match(pattern);
788 expectedmatch = Array('effgz', 'effgz', undefined);
791 status = inSection(98);
792 pattern = /((((((((((a))))))))))/;
794 actualmatch = string.match(pattern);
795 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
798 status = inSection(99);
799 pattern = /((((((((((a))))))))))\10/;
801 actualmatch = string.match(pattern);
802 expectedmatch = Array('aa', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
805 status = inSection(100);
806 pattern = /((((((((((a))))))))))/;
808 actualmatch = string.match(pattern);
809 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
812 status = inSection(101);
813 pattern = /(((((((((a)))))))))/;
815 actualmatch = string.match(pattern);
816 expectedmatch = Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
819 status = inSection(102);
820 pattern = /(.*)c(.*)/;
822 actualmatch = string.match(pattern);
823 expectedmatch = Array('abcde', 'ab', 'de');
826 status = inSection(103);
829 actualmatch = string.match(pattern);
830 expectedmatch = Array('abcd');
833 status = inSection(104);
836 actualmatch = string.match(pattern);
837 expectedmatch = Array('abcd', 'bc');
840 status = inSection(105);
843 actualmatch = string.match(pattern);
844 expectedmatch = Array('ac');
847 status = inSection(106);
850 actualmatch = string.match(pattern);
851 expectedmatch = Array('abcabc', 'abc');
854 status = inSection(107);
855 pattern = /([a-c]*)\1/;
857 actualmatch = string.match(pattern);
858 expectedmatch = Array('abcabc', 'abc');
861 status = inSection(108);
864 actualmatch = string.match(pattern);
865 expectedmatch = Array('a', 'a');
868 status = inSection(109);
869 pattern = /(([a-c])b*?\2)*/;
870 string = 'ababbbcbc';
871 actualmatch = string.match(pattern);
872 expectedmatch = Array('ababb', 'bb', 'b');
875 status = inSection(110);
876 pattern = /(([a-c])b*?\2){3}/;
877 string = 'ababbbcbc';
878 actualmatch = string.match(pattern);
879 expectedmatch = Array('ababbbcbc', 'cbc', 'c');
882 /* Can't refer to a capture before it's encountered & completed
883 status = inSection(111);
884 pattern = /((\3|b)\2(a)x)+/;
885 string = 'aaaxabaxbaaxbbax';
886 actualmatch = string.match(pattern);
887 expectedmatch = Array('bbax', 'bbax', 'b', 'a');
890 status = inSection(112);
891 pattern = /((\3|b)\2(a)){2,}/;
892 string = 'bbaababbabaaaaabbaaaabba';
893 actualmatch = string.match(pattern);
894 expectedmatch = Array('bbaaaabba', 'bba', 'b', 'a');
898 status = inSection(113);
901 actualmatch = string.match(pattern);
902 expectedmatch = Array('ABC');
905 status = inSection(114);
908 actualmatch = string.match(pattern);
909 expectedmatch = Array('ABC');
912 status = inSection(115);
915 actualmatch = string.match(pattern);
916 expectedmatch = Array('ABC');
919 status = inSection(116);
922 actualmatch = string.match(pattern);
923 expectedmatch = Array('ABC');
926 status = inSection(117);
929 actualmatch = string.match(pattern);
930 expectedmatch = Array('ABC');
933 status = inSection(118);
936 actualmatch = string.match(pattern);
937 expectedmatch = Array('ABBC');
940 status = inSection(119);
943 actualmatch = string.match(pattern);
944 expectedmatch = Array('ABBBBC');
947 status = inSection(120);
948 pattern = /ab{0,}?bc/i;
950 actualmatch = string.match(pattern);
951 expectedmatch = Array('ABBBBC');
954 status = inSection(121);
957 actualmatch = string.match(pattern);
958 expectedmatch = Array('ABBC');
961 status = inSection(122);
964 actualmatch = string.match(pattern);
965 expectedmatch = Array('ABBBBC');
968 status = inSection(123);
969 pattern = /ab{1,}?bc/i;
971 actualmatch = string.match(pattern);
972 expectedmatch = Array('ABBBBC');
975 status = inSection(124);
976 pattern = /ab{1,3}?bc/i;
978 actualmatch = string.match(pattern);
979 expectedmatch = Array('ABBBBC');
982 status = inSection(125);
983 pattern = /ab{3,4}?bc/i;
985 actualmatch = string.match(pattern);
986 expectedmatch = Array('ABBBBC');
989 status = inSection(126);
992 actualmatch = string.match(pattern);
993 expectedmatch = Array('ABBC');
996 status = inSection(127);
999 actualmatch = string.match(pattern);
1000 expectedmatch = Array('ABC');
1003 status = inSection(128);
1004 pattern = /ab{0,1}?bc/i;
1006 actualmatch = string.match(pattern);
1007 expectedmatch = Array('ABC');
1010 status = inSection(129);
1013 actualmatch = string.match(pattern);
1014 expectedmatch = Array('ABC');
1017 status = inSection(130);
1018 pattern = /ab{0,1}?c/i;
1020 actualmatch = string.match(pattern);
1021 expectedmatch = Array('ABC');
1024 status = inSection(131);
1027 actualmatch = string.match(pattern);
1028 expectedmatch = Array('ABC');
1031 status = inSection(132);
1034 actualmatch = string.match(pattern);
1035 expectedmatch = Array('ABC');
1038 status = inSection(133);
1041 actualmatch = string.match(pattern);
1042 expectedmatch = Array('ABC');
1045 status = inSection(134);
1048 actualmatch = string.match(pattern);
1049 expectedmatch = Array('');
1052 status = inSection(135);
1055 actualmatch = string.match(pattern);
1056 expectedmatch = Array('');
1059 status = inSection(136);
1062 actualmatch = string.match(pattern);
1063 expectedmatch = Array('ABC');
1066 status = inSection(137);
1069 actualmatch = string.match(pattern);
1070 expectedmatch = Array('AXC');
1073 status = inSection(138);
1076 actualmatch = string.match(pattern);
1077 expectedmatch = Array('AXYZC');
1080 status = inSection(139);
1081 pattern = /a[bc]d/i;
1083 actualmatch = string.match(pattern);
1084 expectedmatch = Array('ABD');
1087 status = inSection(140);
1088 pattern = /a[b-d]e/i;
1090 actualmatch = string.match(pattern);
1091 expectedmatch = Array('ACE');
1094 status = inSection(141);
1095 pattern = /a[b-d]/i;
1097 actualmatch = string.match(pattern);
1098 expectedmatch = Array('AC');
1101 status = inSection(142);
1104 actualmatch = string.match(pattern);
1105 expectedmatch = Array('A-');
1108 status = inSection(143);
1111 actualmatch = string.match(pattern);
1112 expectedmatch = Array('A-');
1115 status = inSection(144);
1118 actualmatch = string.match(pattern);
1119 expectedmatch = Array('A]');
1122 /* Perl supports ] & ^] inside a [], ECMA does not
1123 status = inSection(145);
1126 actualmatch = string.match(pattern);
1127 expectedmatch = Array('A]B');
1131 status = inSection(146);
1132 pattern = /a[^bc]d/i;
1134 actualmatch = string.match(pattern);
1135 expectedmatch = Array('AED');
1138 status = inSection(147);
1139 pattern = /a[^-b]c/i;
1141 actualmatch = string.match(pattern);
1142 expectedmatch = Array('ADC');
1145 /* Perl supports ] & ^] inside a [], ECMA does not
1146 status = inSection(148);
1147 pattern = /a[^]b]c/i;
1149 actualmatch = string.match(pattern);
1150 expectedmatch = Array('ADC');
1154 status = inSection(149);
1157 actualmatch = string.match(pattern);
1158 expectedmatch = Array('AB');
1161 status = inSection(150);
1164 actualmatch = string.match(pattern);
1165 expectedmatch = Array('AB');
1168 status = inSection(151);
1171 actualmatch = string.match(pattern);
1172 expectedmatch = Array('EF', '');
1175 status = inSection(152);
1178 actualmatch = string.match(pattern);
1179 expectedmatch = Array('A(B');
1182 status = inSection(153);
1185 actualmatch = string.match(pattern);
1186 expectedmatch = Array('AB');
1189 status = inSection(154);
1192 actualmatch = string.match(pattern);
1193 expectedmatch = Array('A((B');
1196 status = inSection(155);
1199 actualmatch = string.match(pattern);
1200 expectedmatch = Array('A\\B');
1203 status = inSection(156);
1206 actualmatch = string.match(pattern);
1207 expectedmatch = Array('A', 'A', 'A');
1210 status = inSection(157);
1211 pattern = /(a)b(c)/i;
1213 actualmatch = string.match(pattern);
1214 expectedmatch = Array('ABC', 'A', 'C');
1217 status = inSection(158);
1220 actualmatch = string.match(pattern);
1221 expectedmatch = Array('ABC');
1224 status = inSection(159);
1225 pattern = /a{1,}b{1,}c/i;
1227 actualmatch = string.match(pattern);
1228 expectedmatch = Array('ABC');
1231 status = inSection(160);
1234 actualmatch = string.match(pattern);
1235 expectedmatch = Array('ABC');
1238 status = inSection(161);
1241 actualmatch = string.match(pattern);
1242 expectedmatch = Array('ABC');
1245 status = inSection(162);
1246 pattern = /a.{0,5}?c/i;
1248 actualmatch = string.match(pattern);
1249 expectedmatch = Array('ABC');
1252 status = inSection(163);
1253 pattern = /(a+|b)*/i;
1255 actualmatch = string.match(pattern);
1256 expectedmatch = Array('AB', 'B');
1259 status = inSection(164);
1260 pattern = /(a+|b){0,}/i;
1262 actualmatch = string.match(pattern);
1263 expectedmatch = Array('AB', 'B');
1266 status = inSection(165);
1267 pattern = /(a+|b)+/i;
1269 actualmatch = string.match(pattern);
1270 expectedmatch = Array('AB', 'B');
1273 status = inSection(166);
1274 pattern = /(a+|b){1,}/i;
1276 actualmatch = string.match(pattern);
1277 expectedmatch = Array('AB', 'B');
1280 status = inSection(167);
1281 pattern = /(a+|b)?/i;
1283 actualmatch = string.match(pattern);
1284 expectedmatch = Array('A', 'A');
1287 status = inSection(168);
1288 pattern = /(a+|b){0,1}/i;
1290 actualmatch = string.match(pattern);
1291 expectedmatch = Array('A', 'A');
1294 status = inSection(169);
1295 pattern = /(a+|b){0,1}?/i;
1297 actualmatch = string.match(pattern);
1298 expectedmatch = Array('', undefined);
1301 status = inSection(170);
1302 pattern = /[^ab]*/i;
1304 actualmatch = string.match(pattern);
1305 expectedmatch = Array('CDE');
1308 status = inSection(171);
1309 pattern = /([abc])*d/i;
1311 actualmatch = string.match(pattern);
1312 expectedmatch = Array('ABBBCD', 'C');
1315 status = inSection(172);
1316 pattern = /([abc])*bcd/i;
1318 actualmatch = string.match(pattern);
1319 expectedmatch = Array('ABCD', 'A');
1322 status = inSection(173);
1323 pattern = /a|b|c|d|e/i;
1325 actualmatch = string.match(pattern);
1326 expectedmatch = Array('E');
1329 status = inSection(174);
1330 pattern = /(a|b|c|d|e)f/i;
1332 actualmatch = string.match(pattern);
1333 expectedmatch = Array('EF', 'E');
1336 status = inSection(175);
1337 pattern = /abcd*efg/i;
1339 actualmatch = string.match(pattern);
1340 expectedmatch = Array('ABCDEFG');
1343 status = inSection(176);
1345 string = 'XABYABBBZ';
1346 actualmatch = string.match(pattern);
1347 expectedmatch = Array('AB');
1350 status = inSection(177);
1352 string = 'XAYABBBZ';
1353 actualmatch = string.match(pattern);
1354 expectedmatch = Array('A');
1357 status = inSection(178);
1358 pattern = /(ab|cd)e/i;
1360 actualmatch = string.match(pattern);
1361 expectedmatch = Array('CDE', 'CD');
1364 status = inSection(179);
1365 pattern = /[abhgefdc]ij/i;
1367 actualmatch = string.match(pattern);
1368 expectedmatch = Array('HIJ');
1371 status = inSection(180);
1372 pattern = /(abc|)ef/i;
1374 actualmatch = string.match(pattern);
1375 expectedmatch = Array('EF', '');
1378 status = inSection(181);
1379 pattern = /(a|b)c*d/i;
1381 actualmatch = string.match(pattern);
1382 expectedmatch = Array('BCD', 'B');
1385 status = inSection(182);
1386 pattern = /(ab|ab*)bc/i;
1388 actualmatch = string.match(pattern);
1389 expectedmatch = Array('ABC', 'A');
1392 status = inSection(183);
1393 pattern = /a([bc]*)c*/i;
1395 actualmatch = string.match(pattern);
1396 expectedmatch = Array('ABC', 'BC');
1399 status = inSection(184);
1400 pattern = /a([bc]*)(c*d)/i;
1402 actualmatch = string.match(pattern);
1403 expectedmatch = Array('ABCD', 'BC', 'D');
1406 status = inSection(185);
1407 pattern = /a([bc]+)(c*d)/i;
1409 actualmatch = string.match(pattern);
1410 expectedmatch = Array('ABCD', 'BC', 'D');
1413 status = inSection(186);
1414 pattern = /a([bc]*)(c+d)/i;
1416 actualmatch = string.match(pattern);
1417 expectedmatch = Array('ABCD', 'B', 'CD');
1420 status = inSection(187);
1421 pattern = /a[bcd]*dcdcde/i;
1423 actualmatch = string.match(pattern);
1424 expectedmatch = Array('ADCDCDE');
1427 status = inSection(188);
1428 pattern = /(ab|a)b*c/i;
1430 actualmatch = string.match(pattern);
1431 expectedmatch = Array('ABC', 'AB');
1434 status = inSection(189);
1435 pattern = /((a)(b)c)(d)/i;
1437 actualmatch = string.match(pattern);
1438 expectedmatch = Array('ABCD', 'ABC', 'A', 'B', 'D');
1441 status = inSection(190);
1442 pattern = /[a-zA-Z_][a-zA-Z0-9_]*/i;
1444 actualmatch = string.match(pattern);
1445 expectedmatch = Array('ALPHA');
1448 status = inSection(191);
1449 pattern = /^a(bc+|b[eh])g|.h$/i;
1451 actualmatch = string.match(pattern);
1452 expectedmatch = Array('BH', undefined);
1455 status = inSection(192);
1456 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1458 actualmatch = string.match(pattern);
1459 expectedmatch = Array('EFFGZ', 'EFFGZ', undefined);
1462 status = inSection(193);
1463 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1465 actualmatch = string.match(pattern);
1466 expectedmatch = Array('IJ', 'IJ', 'J');
1469 status = inSection(194);
1470 pattern = /(bc+d$|ef*g.|h?i(j|k))/i;
1472 actualmatch = string.match(pattern);
1473 expectedmatch = Array('EFFGZ', 'EFFGZ', undefined);
1476 status = inSection(195);
1477 pattern = /((((((((((a))))))))))/i;
1479 actualmatch = string.match(pattern);
1480 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1483 status = inSection(196);
1484 pattern = /((((((((((a))))))))))\10/i;
1486 actualmatch = string.match(pattern);
1487 expectedmatch = Array('AA', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1490 status = inSection(197);
1491 pattern = /((((((((((a))))))))))/i;
1493 actualmatch = string.match(pattern);
1494 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1497 status = inSection(198);
1498 pattern = /(((((((((a)))))))))/i;
1500 actualmatch = string.match(pattern);
1501 expectedmatch = Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1504 status = inSection(199);
1505 pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i;
1507 actualmatch = string.match(pattern);
1508 expectedmatch = Array('A', 'A');
1511 status = inSection(200);
1512 pattern = /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i;
1514 actualmatch = string.match(pattern);
1515 expectedmatch = Array('C', 'C');
1518 status = inSection(201);
1519 pattern = /(.*)c(.*)/i;
1521 actualmatch = string.match(pattern);
1522 expectedmatch = Array('ABCDE', 'AB', 'DE');
1525 status = inSection(202);
1528 actualmatch = string.match(pattern);
1529 expectedmatch = Array('ABCD');
1532 status = inSection(203);
1533 pattern = /a(bc)d/i;
1535 actualmatch = string.match(pattern);
1536 expectedmatch = Array('ABCD', 'BC');
1539 status = inSection(204);
1540 pattern = /a[-]?c/i;
1542 actualmatch = string.match(pattern);
1543 expectedmatch = Array('AC');
1546 status = inSection(205);
1547 pattern = /(abc)\1/i;
1549 actualmatch = string.match(pattern);
1550 expectedmatch = Array('ABCABC', 'ABC');
1553 status = inSection(206);
1554 pattern = /([a-c]*)\1/i;
1556 actualmatch = string.match(pattern);
1557 expectedmatch = Array('ABCABC', 'ABC');
1560 status = inSection(207);
1561 pattern = /a(?!b)./;
1563 actualmatch = string.match(pattern);
1564 expectedmatch = Array('ad');
1567 status = inSection(208);
1568 pattern = /a(?=d)./;
1570 actualmatch = string.match(pattern);
1571 expectedmatch = Array('ad');
1574 status = inSection(209);
1575 pattern = /a(?=c|d)./;
1577 actualmatch = string.match(pattern);
1578 expectedmatch = Array('ad');
1581 status = inSection(210);
1582 pattern = /a(?:b|c|d)(.)/;
1584 actualmatch = string.match(pattern);
1585 expectedmatch = Array('ace', 'e');
1588 status = inSection(211);
1589 pattern = /a(?:b|c|d)*(.)/;
1591 actualmatch = string.match(pattern);
1592 expectedmatch = Array('ace', 'e');
1595 status = inSection(212);
1596 pattern = /a(?:b|c|d)+?(.)/;
1598 actualmatch = string.match(pattern);
1599 expectedmatch = Array('ace', 'e');
1602 status = inSection(213);
1603 pattern = /a(?:b|c|d)+?(.)/;
1604 string = 'acdbcdbe';
1605 actualmatch = string.match(pattern);
1606 expectedmatch = Array('acd', 'd');
1609 status = inSection(214);
1610 pattern = /a(?:b|c|d)+(.)/;
1611 string = 'acdbcdbe';
1612 actualmatch = string.match(pattern);
1613 expectedmatch = Array('acdbcdbe', 'e');
1616 status = inSection(215);
1617 pattern = /a(?:b|c|d){2}(.)/;
1618 string = 'acdbcdbe';
1619 actualmatch = string.match(pattern);
1620 expectedmatch = Array('acdb', 'b');
1623 status = inSection(216);
1624 pattern = /a(?:b|c|d){4,5}(.)/;
1625 string = 'acdbcdbe';
1626 actualmatch = string.match(pattern);
1627 expectedmatch = Array('acdbcdb', 'b');
1630 status = inSection(217);
1631 pattern = /a(?:b|c|d){4,5}?(.)/;
1632 string = 'acdbcdbe';
1633 actualmatch = string.match(pattern);
1634 expectedmatch = Array('acdbcd', 'd');
1637 // MODIFIED - ECMA has different rules for paren contents
1638 status = inSection(218);
1639 pattern = /((foo)|(bar))*/;
1641 actualmatch = string.match(pattern);
1642 //expectedmatch = Array('foobar', 'bar', 'foo', 'bar');
1643 expectedmatch = Array('foobar', 'bar', undefined, 'bar');
1646 status = inSection(219);
1647 pattern = /a(?:b|c|d){6,7}(.)/;
1648 string = 'acdbcdbe';
1649 actualmatch = string.match(pattern);
1650 expectedmatch = Array('acdbcdbe', 'e');
1653 status = inSection(220);
1654 pattern = /a(?:b|c|d){6,7}?(.)/;
1655 string = 'acdbcdbe';
1656 actualmatch = string.match(pattern);
1657 expectedmatch = Array('acdbcdbe', 'e');
1660 status = inSection(221);
1661 pattern = /a(?:b|c|d){5,6}(.)/;
1662 string = 'acdbcdbe';
1663 actualmatch = string.match(pattern);
1664 expectedmatch = Array('acdbcdbe', 'e');
1667 status = inSection(222);
1668 pattern = /a(?:b|c|d){5,6}?(.)/;
1669 string = 'acdbcdbe';
1670 actualmatch = string.match(pattern);
1671 expectedmatch = Array('acdbcdb', 'b');
1674 status = inSection(223);
1675 pattern = /a(?:b|c|d){5,7}(.)/;
1676 string = 'acdbcdbe';
1677 actualmatch = string.match(pattern);
1678 expectedmatch = Array('acdbcdbe', 'e');
1681 status = inSection(224);
1682 pattern = /a(?:b|c|d){5,7}?(.)/;
1683 string = 'acdbcdbe';
1684 actualmatch = string.match(pattern);
1685 expectedmatch = Array('acdbcdb', 'b');
1688 status = inSection(225);
1689 pattern = /a(?:b|(c|e){1,2}?|d)+?(.)/;
1691 actualmatch = string.match(pattern);
1692 expectedmatch = Array('ace', 'c', 'e');
1695 status = inSection(226);
1696 pattern = /^(.+)?B/;
1698 actualmatch = string.match(pattern);
1699 expectedmatch = Array('AB', 'A');
1702 /* MODIFIED - ECMA has different rules for paren contents */
1703 status = inSection(227);
1704 pattern = /^([^a-z])|(\^)$/;
1706 actualmatch = string.match(pattern);
1707 //expectedmatch = Array('.', '.', '');
1708 expectedmatch = Array('.', '.', undefined);
1711 status = inSection(228);
1714 actualmatch = string.match(pattern);
1715 expectedmatch = Array('<&');
1718 /* Can't refer to a capture before it's encountered & completed
1719 status = inSection(229);
1720 pattern = /^(a\1?){4}$/;
1721 string = 'aaaaaaaaaa';
1722 actualmatch = string.match(pattern);
1723 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1726 status = inSection(230);
1727 pattern = /^(a(?(1)\1)){4}$/;
1728 string = 'aaaaaaaaaa';
1729 actualmatch = string.match(pattern);
1730 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1734 status = inSection(231);
1735 pattern = /((a{4})+)/;
1736 string = 'aaaaaaaaa';
1737 actualmatch = string.match(pattern);
1738 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa');
1741 status = inSection(232);
1742 pattern = /(((aa){2})+)/;
1743 string = 'aaaaaaaaaa';
1744 actualmatch = string.match(pattern);
1745 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1748 status = inSection(233);
1749 pattern = /(((a{2}){2})+)/;
1750 string = 'aaaaaaaaaa';
1751 actualmatch = string.match(pattern);
1752 expectedmatch = Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1755 status = inSection(234);
1756 pattern = /(?:(f)(o)(o)|(b)(a)(r))*/;
1758 actualmatch = string.match(pattern);
1759 //expectedmatch = Array('foobar', 'f', 'o', 'o', 'b', 'a', 'r');
1760 expectedmatch = Array('foobar', undefined, undefined, undefined, 'b', 'a', 'r');
1763 /* ECMA supports (?: (?= and (?! but doesn't support (?< etc.
1764 status = inSection(235);
1765 pattern = /(?<=a)b/;
1767 actualmatch = string.match(pattern);
1768 expectedmatch = Array('b');
1771 status = inSection(236);
1772 pattern = /(?<!c)b/;
1774 actualmatch = string.match(pattern);
1775 expectedmatch = Array('b');
1778 status = inSection(237);
1779 pattern = /(?<!c)b/;
1781 actualmatch = string.match(pattern);
1782 expectedmatch = Array('b');
1785 status = inSection(238);
1786 pattern = /(?<!c)b/;
1788 actualmatch = string.match(pattern);
1789 expectedmatch = Array('b');
1793 status = inSection(239);
1794 pattern = /(?:..)*a/;
1796 actualmatch = string.match(pattern);
1797 expectedmatch = Array('aba');
1800 status = inSection(240);
1801 pattern = /(?:..)*?a/;
1803 actualmatch = string.match(pattern);
1804 expectedmatch = Array('a');
1808 * MODIFIED - ECMA has different rules for paren contents. Note
1809 * this regexp has two non-capturing parens, and one capturing
1811 * The issue: shouldn't the match be ['ab', undefined]? Because the
1812 * '\1' matches the undefined value of the second iteration of the '*'
1813 * (in which the 'b' part of the '|' matches). But Perl wants ['ab','b'].
1815 * Answer: waldemar@netscape.com:
1817 * The correct answer is ['ab', undefined]. Perl doesn't match
1818 * ECMAScript here, and I'd say that Perl is wrong in this case.
1820 status = inSection(241);
1821 pattern = /^(?:b|a(?=(.)))*\1/;
1823 actualmatch = string.match(pattern);
1824 //expectedmatch = Array('ab', 'b');
1825 expectedmatch = Array('ab', undefined);
1828 status = inSection(242);
1829 pattern = /^(){3,5}/;
1831 actualmatch = string.match(pattern);
1832 expectedmatch = Array('', '');
1835 status = inSection(243);
1836 pattern = /^(a+)*ax/;
1838 actualmatch = string.match(pattern);
1839 expectedmatch = Array('aax', 'a');
1842 status = inSection(244);
1843 pattern = /^((a|b)+)*ax/;
1845 actualmatch = string.match(pattern);
1846 expectedmatch = Array('aax', 'a', 'a');
1849 status = inSection(245);
1850 pattern = /^((a|bc)+)*ax/;
1852 actualmatch = string.match(pattern);
1853 expectedmatch = Array('aax', 'a', 'a');
1856 /* MODIFIED - ECMA has different rules for paren contents */
1857 status = inSection(246);
1858 pattern = /(a|x)*ab/;
1860 actualmatch = string.match(pattern);
1861 //expectedmatch = Array('ab', '');
1862 expectedmatch = Array('ab', undefined);
1865 status = inSection(247);
1868 actualmatch = string.match(pattern);
1869 expectedmatch = Array('ab', undefined);
1872 /* ECMA doesn't support (?imsx or (?-imsx
1873 status = inSection(248);
1874 pattern = /(?:(?i)a)b/;
1876 actualmatch = string.match(pattern);
1877 expectedmatch = Array('ab');
1880 status = inSection(249);
1881 pattern = /((?i)a)b/;
1883 actualmatch = string.match(pattern);
1884 expectedmatch = Array('ab', 'a');
1887 status = inSection(250);
1888 pattern = /(?:(?i)a)b/;
1890 actualmatch = string.match(pattern);
1891 expectedmatch = Array('Ab');
1894 status = inSection(251);
1895 pattern = /((?i)a)b/;
1897 actualmatch = string.match(pattern);
1898 expectedmatch = Array('Ab', 'A');
1901 status = inSection(252);
1902 pattern = /(?i:a)b/;
1904 actualmatch = string.match(pattern);
1905 expectedmatch = Array('ab');
1908 status = inSection(253);
1909 pattern = /((?i:a))b/;
1911 actualmatch = string.match(pattern);
1912 expectedmatch = Array('ab', 'a');
1915 status = inSection(254);
1916 pattern = /(?i:a)b/;
1918 actualmatch = string.match(pattern);
1919 expectedmatch = Array('Ab');
1922 status = inSection(255);
1923 pattern = /((?i:a))b/;
1925 actualmatch = string.match(pattern);
1926 expectedmatch = Array('Ab', 'A');
1929 status = inSection(256);
1930 pattern = /(?:(?-i)a)b/i;
1932 actualmatch = string.match(pattern);
1933 expectedmatch = Array('ab');
1936 status = inSection(257);
1937 pattern = /((?-i)a)b/i;
1939 actualmatch = string.match(pattern);
1940 expectedmatch = Array('ab', 'a');
1943 status = inSection(258);
1944 pattern = /(?:(?-i)a)b/i;
1946 actualmatch = string.match(pattern);
1947 expectedmatch = Array('aB');
1950 status = inSection(259);
1951 pattern = /((?-i)a)b/i;
1953 actualmatch = string.match(pattern);
1954 expectedmatch = Array('aB', 'a');
1957 status = inSection(260);
1958 pattern = /(?:(?-i)a)b/i;
1960 actualmatch = string.match(pattern);
1961 expectedmatch = Array('aB');
1964 status = inSection(261);
1965 pattern = /((?-i)a)b/i;
1967 actualmatch = string.match(pattern);
1968 expectedmatch = Array('aB', 'a');
1971 status = inSection(262);
1972 pattern = /(?-i:a)b/i;
1974 actualmatch = string.match(pattern);
1975 expectedmatch = Array('ab');
1978 status = inSection(263);
1979 pattern = /((?-i:a))b/i;
1981 actualmatch = string.match(pattern);
1982 expectedmatch = Array('ab', 'a');
1985 status = inSection(264);
1986 pattern = /(?-i:a)b/i;
1988 actualmatch = string.match(pattern);
1989 expectedmatch = Array('aB');
1992 status = inSection(265);
1993 pattern = /((?-i:a))b/i;
1995 actualmatch = string.match(pattern);
1996 expectedmatch = Array('aB', 'a');
1999 status = inSection(266);
2000 pattern = /(?-i:a)b/i;
2002 actualmatch = string.match(pattern);
2003 expectedmatch = Array('aB');
2006 status = inSection(267);
2007 pattern = /((?-i:a))b/i;
2009 actualmatch = string.match(pattern);
2010 expectedmatch = Array('aB', 'a');
2013 status = inSection(268);
2014 pattern = /((?s-i:a.))b/i;
2016 actualmatch = string.match(pattern);
2017 expectedmatch = Array('a\nB', 'a\n');
2021 status = inSection(269);
2022 pattern = /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/;
2024 actualmatch = string.match(pattern);
2025 expectedmatch = Array('cabbbb');
2028 status = inSection(270);
2029 pattern = /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/;
2030 string = 'caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
2031 actualmatch = string.match(pattern);
2032 expectedmatch = Array('caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
2035 status = inSection(271);
2036 pattern = /(ab)\d\1/i;
2038 actualmatch = string.match(pattern);
2039 expectedmatch = Array('Ab4ab', 'Ab');
2042 status = inSection(272);
2043 pattern = /(ab)\d\1/i;
2045 actualmatch = string.match(pattern);
2046 expectedmatch = Array('ab4Ab', 'ab');
2049 status = inSection(273);
2050 pattern = /foo\w*\d{4}baz/;
2051 string = 'foobar1234baz';
2052 actualmatch = string.match(pattern);
2053 expectedmatch = Array('foobar1234baz');
2056 status = inSection(274);
2057 pattern = /x(~~)*(?:(?:F)?)?/;
2059 actualmatch = string.match(pattern);
2060 expectedmatch = Array('x~~', '~~');
2063 /* Perl supports (?# but JS doesn't
2064 status = inSection(275);
2065 pattern = /^a(?#xxx){3}c/;
2067 actualmatch = string.match(pattern);
2068 expectedmatch = Array('aaac');
2072 /* ECMA doesn't support (?< etc
2073 status = inSection(276);
2074 pattern = /(?<![cd])[ab]/;
2076 actualmatch = string.match(pattern);
2077 expectedmatch = Array('a');
2080 status = inSection(277);
2081 pattern = /(?<!(c|d))[ab]/;
2083 actualmatch = string.match(pattern);
2084 expectedmatch = Array('a');
2087 status = inSection(278);
2088 pattern = /(?<!cd)[ab]/;
2090 actualmatch = string.match(pattern);
2091 expectedmatch = Array('b');
2094 status = inSection(279);
2095 pattern = /((?s)^a(.))((?m)^b$)/;
2096 string = 'a\nb\nc\n';
2097 actualmatch = string.match(pattern);
2098 expectedmatch = Array('a\nb', 'a\n', '\n', 'b');
2101 status = inSection(280);
2102 pattern = /((?m)^b$)/;
2103 string = 'a\nb\nc\n';
2104 actualmatch = string.match(pattern);
2105 expectedmatch = Array('b', 'b');
2108 status = inSection(281);
2111 actualmatch = string.match(pattern);
2112 expectedmatch = Array('b');
2115 status = inSection(282);
2116 pattern = /(?m)^(b)/;
2118 actualmatch = string.match(pattern);
2119 expectedmatch = Array('b', 'b');
2122 status = inSection(283);
2123 pattern = /((?m)^b)/;
2125 actualmatch = string.match(pattern);
2126 expectedmatch = Array('b', 'b');
2129 status = inSection(284);
2130 pattern = /\n((?m)^b)/;
2132 actualmatch = string.match(pattern);
2133 expectedmatch = Array('\nb', 'b');
2136 status = inSection(285);
2137 pattern = /((?s).)c(?!.)/;
2138 string = 'a\nb\nc\n';
2139 actualmatch = string.match(pattern);
2140 expectedmatch = Array('\nc', '\n');
2143 status = inSection(286);
2144 pattern = /((?s).)c(?!.)/;
2145 string = 'a\nb\nc\n';
2146 actualmatch = string.match(pattern);
2147 expectedmatch = Array('\nc', '\n');
2150 status = inSection(287);
2151 pattern = /((?s)b.)c(?!.)/;
2152 string = 'a\nb\nc\n';
2153 actualmatch = string.match(pattern);
2154 expectedmatch = Array('b\nc', 'b\n');
2157 status = inSection(288);
2158 pattern = /((?s)b.)c(?!.)/;
2159 string = 'a\nb\nc\n';
2160 actualmatch = string.match(pattern);
2161 expectedmatch = Array('b\nc', 'b\n');
2164 status = inSection(289);
2165 pattern = /((?m)^b)/;
2166 string = 'a\nb\nc\n';
2167 actualmatch = string.match(pattern);
2168 expectedmatch = Array('b', 'b');
2172 /* ECMA doesn't support (?(condition)
2173 status = inSection(290);
2174 pattern = /(?(1)b|a)/;
2176 actualmatch = string.match(pattern);
2177 expectedmatch = Array('a');
2180 status = inSection(291);
2181 pattern = /(x)?(?(1)b|a)/;
2183 actualmatch = string.match(pattern);
2184 expectedmatch = Array('a');
2187 status = inSection(292);
2188 pattern = /()?(?(1)b|a)/;
2190 actualmatch = string.match(pattern);
2191 expectedmatch = Array('a');
2194 status = inSection(293);
2195 pattern = /()?(?(1)a|b)/;
2197 actualmatch = string.match(pattern);
2198 expectedmatch = Array('a');
2201 status = inSection(294);
2202 pattern = /^(\()?blah(?(1)(\)))$/;
2204 actualmatch = string.match(pattern);
2205 expectedmatch = Array('(blah)', '(', ')');
2208 status = inSection(295);
2209 pattern = /^(\()?blah(?(1)(\)))$/;
2211 actualmatch = string.match(pattern);
2212 expectedmatch = Array('blah');
2215 status = inSection(296);
2216 pattern = /^(\(+)?blah(?(1)(\)))$/;
2218 actualmatch = string.match(pattern);
2219 expectedmatch = Array('(blah)', '(', ')');
2222 status = inSection(297);
2223 pattern = /^(\(+)?blah(?(1)(\)))$/;
2225 actualmatch = string.match(pattern);
2226 expectedmatch = Array('blah');
2229 status = inSection(298);
2230 pattern = /(?(?!a)b|a)/;
2232 actualmatch = string.match(pattern);
2233 expectedmatch = Array('a');
2236 status = inSection(299);
2237 pattern = /(?(?=a)a|b)/;
2239 actualmatch = string.match(pattern);
2240 expectedmatch = Array('a');
2244 status = inSection(300);
2245 pattern = /(?=(a+?))(\1ab)/;
2247 actualmatch = string.match(pattern);
2248 expectedmatch = Array('aab', 'a', 'aab');
2251 status = inSection(301);
2252 pattern = /(\w+:)+/;
2254 actualmatch = string.match(pattern);
2255 expectedmatch = Array('one:', 'one:');
2258 /* ECMA doesn't support (?< etc
2259 status = inSection(302);
2260 pattern = /$(?<=^(a))/;
2262 actualmatch = string.match(pattern);
2263 expectedmatch = Array('', 'a');
2267 status = inSection(303);
2268 pattern = /(?=(a+?))(\1ab)/;
2270 actualmatch = string.match(pattern);
2271 expectedmatch = Array('aab', 'a', 'aab');
2274 /* MODIFIED - ECMA has different rules for paren contents */
2275 status = inSection(304);
2276 pattern = /([\w:]+::)?(\w+)$/;
2278 actualmatch = string.match(pattern);
2279 //expectedmatch = Array('abcd', '', 'abcd');
2280 expectedmatch = Array('abcd', undefined, 'abcd');
2283 status = inSection(305);
2284 pattern = /([\w:]+::)?(\w+)$/;
2285 string = 'xy:z:::abcd';
2286 actualmatch = string.match(pattern);
2287 expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2290 status = inSection(306);
2291 pattern = /^[^bcd]*(c+)/;
2293 actualmatch = string.match(pattern);
2294 expectedmatch = Array('aexyc', 'c');
2297 status = inSection(307);
2300 actualmatch = string.match(pattern);
2301 expectedmatch = Array('aab', 'aa');
2304 /* MODIFIED - ECMA has different rules for paren contents */
2305 status = inSection(308);
2306 pattern = /([\w:]+::)?(\w+)$/;
2308 actualmatch = string.match(pattern);
2309 //expectedmatch = Array('abcd', '', 'abcd');
2310 expectedmatch = Array('abcd', undefined, 'abcd');
2313 status = inSection(309);
2314 pattern = /([\w:]+::)?(\w+)$/;
2315 string = 'xy:z:::abcd';
2316 actualmatch = string.match(pattern);
2317 expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2320 status = inSection(310);
2321 pattern = /^[^bcd]*(c+)/;
2323 actualmatch = string.match(pattern);
2324 expectedmatch = Array('aexyc', 'c');
2327 /* ECMA doesn't support (?>
2328 status = inSection(311);
2329 pattern = /(?>a+)b/;
2331 actualmatch = string.match(pattern);
2332 expectedmatch = Array('aaab');
2336 status = inSection(312);
2337 pattern = /([[:]+)/;
2339 actualmatch = string.match(pattern);
2340 expectedmatch = Array(':[', ':[');
2343 status = inSection(313);
2344 pattern = /([[=]+)/;
2346 actualmatch = string.match(pattern);
2347 expectedmatch = Array('=[', '=[');
2350 status = inSection(314);
2351 pattern = /([[.]+)/;
2353 actualmatch = string.match(pattern);
2354 expectedmatch = Array('.[', '.[');
2357 /* ECMA doesn't have rules for [:
2358 status = inSection(315);
2359 pattern = /[a[:]b[:c]/;
2361 actualmatch = string.match(pattern);
2362 expectedmatch = Array('abc');
2366 /* ECMA doesn't support (?>
2367 status = inSection(316);
2368 pattern = /((?>a+)b)/;
2370 actualmatch = string.match(pattern);
2371 expectedmatch = Array('aaab', 'aaab');
2374 status = inSection(317);
2375 pattern = /(?>(a+))b/;
2377 actualmatch = string.match(pattern);
2378 expectedmatch = Array('aaab', 'aaa');
2381 status = inSection(318);
2382 pattern = /((?>[^()]+)|\([^()]*\))+/;
2383 string = '((abc(ade)ufh()()x';
2384 actualmatch = string.match(pattern);
2385 expectedmatch = Array('abc(ade)ufh()()x', 'x');
2389 /* Perl has \Z has end-of-line, ECMA doesn't
2390 status = inSection(319);
2393 actualmatch = string.match(pattern);
2394 expectedmatch = Array('');
2397 status = inSection(320);
2400 actualmatch = string.match(pattern);
2401 expectedmatch = Array('');
2405 status = inSection(321);
2408 actualmatch = string.match(pattern);
2409 expectedmatch = Array('');
2412 /* Perl has \Z has end-of-line, ECMA doesn't
2413 status = inSection(322);
2416 actualmatch = string.match(pattern);
2417 expectedmatch = Array('');
2420 status = inSection(323);
2423 actualmatch = string.match(pattern);
2424 expectedmatch = Array('');
2428 status = inSection(324);
2431 actualmatch = string.match(pattern);
2432 expectedmatch = Array('');
2435 /* Perl has \Z has end-of-line, ECMA doesn't
2436 status = inSection(325);
2439 actualmatch = string.match(pattern);
2440 expectedmatch = Array('');
2443 status = inSection(326);
2446 actualmatch = string.match(pattern);
2447 expectedmatch = Array('');
2451 status = inSection(327);
2454 actualmatch = string.match(pattern);
2455 expectedmatch = Array('');
2458 /* Perl has \Z has end-of-line, ECMA doesn't
2459 status = inSection(328);
2462 actualmatch = string.match(pattern);
2463 expectedmatch = Array('');
2466 status = inSection(329);
2469 actualmatch = string.match(pattern);
2470 expectedmatch = Array('');
2474 status = inSection(330);
2477 actualmatch = string.match(pattern);
2478 expectedmatch = Array('');
2481 /* Perl has \Z has end-of-line, ECMA doesn't
2482 status = inSection(331);
2485 actualmatch = string.match(pattern);
2486 expectedmatch = Array('');
2489 status = inSection(332);
2492 actualmatch = string.match(pattern);
2493 expectedmatch = Array('');
2497 status = inSection(333);
2500 actualmatch = string.match(pattern);
2501 expectedmatch = Array('');
2504 /* Perl has \Z has end-of-line, ECMA doesn't
2505 status = inSection(334);
2508 actualmatch = string.match(pattern);
2509 expectedmatch = Array('');
2512 status = inSection(335);
2515 actualmatch = string.match(pattern);
2516 expectedmatch = Array('');
2520 status = inSection(336);
2523 actualmatch = string.match(pattern);
2524 expectedmatch = Array('');
2527 /* Perl has \Z has end-of-line, ECMA doesn't
2528 status = inSection(337);
2531 actualmatch = string.match(pattern);
2532 expectedmatch = Array('a');
2536 /* $ only matches end of input unless multiline
2537 status = inSection(338);
2540 actualmatch = string.match(pattern);
2541 expectedmatch = Array('a');
2545 /* Perl has \Z has end-of-line, ECMA doesn't
2546 status = inSection(339);
2549 actualmatch = string.match(pattern);
2550 expectedmatch = Array('a');
2553 status = inSection(340);
2556 actualmatch = string.match(pattern);
2557 expectedmatch = Array('a');
2561 status = inSection(341);
2564 actualmatch = string.match(pattern);
2565 expectedmatch = Array('a');
2568 status = inSection(342);
2571 actualmatch = string.match(pattern);
2572 expectedmatch = Array('a');
2575 /* Perl has \Z has end-of-line, ECMA doesn't
2576 status = inSection(343);
2579 actualmatch = string.match(pattern);
2580 expectedmatch = Array('a');
2584 status = inSection(344);
2587 actualmatch = string.match(pattern);
2588 expectedmatch = Array('a');
2591 /* Perl has \Z has end-of-line, ECMA doesn't
2592 status = inSection(345);
2595 actualmatch = string.match(pattern);
2596 expectedmatch = Array('a');
2599 status = inSection(346);
2602 actualmatch = string.match(pattern);
2603 expectedmatch = Array('a');
2607 status = inSection(347);
2610 actualmatch = string.match(pattern);
2611 expectedmatch = Array('a');
2614 /* Perl has \Z has end-of-line, ECMA doesn't
2615 status = inSection(348);
2618 actualmatch = string.match(pattern);
2619 expectedmatch = Array('aa');
2623 /* $ only matches end of input unless multiline
2624 status = inSection(349);
2627 actualmatch = string.match(pattern);
2628 expectedmatch = Array('aa');
2632 /* Perl has \Z has end-of-line, ECMA doesn't
2633 status = inSection(350);
2636 actualmatch = string.match(pattern);
2637 expectedmatch = Array('aa');
2640 status = inSection(351);
2643 actualmatch = string.match(pattern);
2644 expectedmatch = Array('aa');
2648 status = inSection(352);
2651 actualmatch = string.match(pattern);
2652 expectedmatch = Array('aa');
2655 status = inSection(353);
2658 actualmatch = string.match(pattern);
2659 expectedmatch = Array('aa');
2662 /* Perl has \Z has end-of-line, ECMA doesn't
2663 status = inSection(354);
2666 actualmatch = string.match(pattern);
2667 expectedmatch = Array('aa');
2671 status = inSection(355);
2674 actualmatch = string.match(pattern);
2675 expectedmatch = Array('aa');
2678 /* Perl has \Z has end-of-line, ECMA doesn't
2679 status = inSection(356);
2682 actualmatch = string.match(pattern);
2683 expectedmatch = Array('aa');
2686 status = inSection(357);
2689 actualmatch = string.match(pattern);
2690 expectedmatch = Array('aa');
2694 status = inSection(358);
2697 actualmatch = string.match(pattern);
2698 expectedmatch = Array('aa');
2701 /* Perl has \Z has end-of-line, ECMA doesn't
2702 status = inSection(359);
2705 actualmatch = string.match(pattern);
2706 expectedmatch = Array('ab');
2710 /* $ only matches end of input unless multiline
2711 status = inSection(360);
2714 actualmatch = string.match(pattern);
2715 expectedmatch = Array('ab');
2719 /* Perl has \Z has end-of-line, ECMA doesn't
2720 status = inSection(361);
2723 actualmatch = string.match(pattern);
2724 expectedmatch = Array('ab');
2727 status = inSection(362);
2730 actualmatch = string.match(pattern);
2731 expectedmatch = Array('ab');
2735 status = inSection(363);
2738 actualmatch = string.match(pattern);
2739 expectedmatch = Array('ab');
2742 status = inSection(364);
2745 actualmatch = string.match(pattern);
2746 expectedmatch = Array('ab');
2749 /* Perl has \Z has end-of-line, ECMA doesn't
2750 status = inSection(365);
2753 actualmatch = string.match(pattern);
2754 expectedmatch = Array('ab');
2758 status = inSection(366);
2761 actualmatch = string.match(pattern);
2762 expectedmatch = Array('ab');
2765 /* Perl has \Z has end-of-line, ECMA doesn't
2766 status = inSection(367);
2769 actualmatch = string.match(pattern);
2770 expectedmatch = Array('ab');
2773 status = inSection(368);
2776 actualmatch = string.match(pattern);
2777 expectedmatch = Array('ab');
2781 status = inSection(369);
2784 actualmatch = string.match(pattern);
2785 expectedmatch = Array('ab');
2788 /* Perl has \Z has end-of-line, ECMA doesn't
2789 status = inSection(370);
2791 string = 'b\nabb\n';
2792 actualmatch = string.match(pattern);
2793 expectedmatch = Array('abb');
2797 /* $ only matches end of input unless multiline
2798 status = inSection(371);
2800 string = 'b\nabb\n';
2801 actualmatch = string.match(pattern);
2802 expectedmatch = Array('abb');
2806 /* Perl has \Z has end-of-line, ECMA doesn't
2807 status = inSection(372);
2810 actualmatch = string.match(pattern);
2811 expectedmatch = Array('abb');
2814 status = inSection(373);
2817 actualmatch = string.match(pattern);
2818 expectedmatch = Array('abb');
2822 status = inSection(374);
2825 actualmatch = string.match(pattern);
2826 expectedmatch = Array('abb');
2829 status = inSection(375);
2831 string = 'abb\nb\n';
2832 actualmatch = string.match(pattern);
2833 expectedmatch = Array('abb');
2836 /* Perl has \Z has end-of-line, ECMA doesn't
2837 status = inSection(376);
2839 string = 'b\nabb\n';
2840 actualmatch = string.match(pattern);
2841 expectedmatch = Array('abb');
2845 status = inSection(377);
2847 string = 'b\nabb\n';
2848 actualmatch = string.match(pattern);
2849 expectedmatch = Array('abb');
2852 /* Perl has \Z has end-of-line, ECMA doesn't
2853 status = inSection(378);
2856 actualmatch = string.match(pattern);
2857 expectedmatch = Array('abb');
2860 status = inSection(379);
2863 actualmatch = string.match(pattern);
2864 expectedmatch = Array('abb');
2868 status = inSection(380);
2871 actualmatch = string.match(pattern);
2872 expectedmatch = Array('abb');
2875 status = inSection(381);
2876 pattern = /(^|x)(c)/;
2878 actualmatch = string.match(pattern);
2879 expectedmatch = Array('c', '', 'c');
2882 status = inSection(382);
2883 pattern = /foo.bart/;
2884 string = 'foo.bart';
2885 actualmatch = string.match(pattern);
2886 expectedmatch = Array('foo.bart');
2889 status = inSection(383);
2890 pattern = /^d[x][x][x]/m;
2891 string = 'abcd\ndxxx';
2892 actualmatch = string.match(pattern);
2893 expectedmatch = Array('dxxx');
2896 status = inSection(384);
2899 actualmatch = string.match(pattern);
2900 expectedmatch = Array('tt');
2903 /* ECMA spec says that each atom in a range must be a single character
2904 status = inSection(385);
2905 pattern = /([a-\d]+)/;
2907 actualmatch = string.match(pattern);
2908 expectedmatch = Array('9', '9');
2911 status = inSection(386);
2912 pattern = /([\d-z]+)/;
2914 actualmatch = string.match(pattern);
2915 expectedmatch = Array('0-z', '0-z');
2919 /* ECMA doesn't support [:
2920 status = inSection(387);
2921 pattern = /([a-[:digit:]]+)/;
2923 actualmatch = string.match(pattern);
2924 expectedmatch = Array('a-9', 'a-9');
2927 status = inSection(388);
2928 pattern = /([[:digit:]-z]+)/;
2930 actualmatch = string.match(pattern);
2931 expectedmatch = Array('0-z', '0-z');
2934 status = inSection(389);
2935 pattern = /([[:digit:]-[:alpha:]]+)/;
2937 actualmatch = string.match(pattern);
2938 expectedmatch = Array('0-z', '0-z');
2942 status = inSection(390);
2943 pattern = /(\d+\.\d+)/;
2944 string = '3.1415926';
2945 actualmatch = string.match(pattern);
2946 expectedmatch = Array('3.1415926', '3.1415926');
2949 status = inSection(391);
2950 pattern = /\.c(pp|xx|c)?$/i;
2952 actualmatch = string.match(pattern);
2953 expectedmatch = Array('.c', undefined);
2956 status = inSection(392);
2957 pattern = /(\.c(pp|xx|c)?$)/i;
2959 actualmatch = string.match(pattern);
2960 expectedmatch = Array('.c', '.c', undefined);
2963 status = inSection(393);
2966 actualmatch = string.match(pattern);
2967 expectedmatch = Array('ab', 'a');
2970 status = inSection(394);
2971 pattern = /^([ab]*?)(b)?(c)$/;
2973 actualmatch = string.match(pattern);
2974 expectedmatch = Array('abac', 'aba', undefined, 'c');
2977 status = inSection(395);
2978 pattern = /^(?:.,){2}c/i;
2980 actualmatch = string.match(pattern);
2981 expectedmatch = Array('a,b,c');
2984 status = inSection(396);
2985 pattern = /^(.,){2}c/i;
2987 actualmatch = string.match(pattern);
2988 expectedmatch = Array('a,b,c', 'b,');
2991 status = inSection(397);
2992 pattern = /^(?:[^,]*,){2}c/;
2994 actualmatch = string.match(pattern);
2995 expectedmatch = Array('a,b,c');
2998 status = inSection(398);
2999 pattern = /^([^,]*,){2}c/;
3001 actualmatch = string.match(pattern);
3002 expectedmatch = Array('a,b,c', 'b,');
3005 status = inSection(399);
3006 pattern = /^([^,]*,){3}d/;
3007 string = 'aaa,b,c,d';
3008 actualmatch = string.match(pattern);
3009 expectedmatch = Array('aaa,b,c,d', 'c,');
3012 status = inSection(400);
3013 pattern = /^([^,]*,){3,}d/;
3014 string = 'aaa,b,c,d';
3015 actualmatch = string.match(pattern);
3016 expectedmatch = Array('aaa,b,c,d', 'c,');
3019 status = inSection(401);
3020 pattern = /^([^,]*,){0,3}d/;
3021 string = 'aaa,b,c,d';
3022 actualmatch = string.match(pattern);
3023 expectedmatch = Array('aaa,b,c,d', 'c,');
3026 status = inSection(402);
3027 pattern = /^([^,]{1,3},){3}d/i;
3028 string = 'aaa,b,c,d';
3029 actualmatch = string.match(pattern);
3030 expectedmatch = Array('aaa,b,c,d', 'c,');
3033 status = inSection(403);
3034 pattern = /^([^,]{1,3},){3,}d/;
3035 string = 'aaa,b,c,d';
3036 actualmatch = string.match(pattern);
3037 expectedmatch = Array('aaa,b,c,d', 'c,');
3040 status = inSection(404);
3041 pattern = /^([^,]{1,3},){0,3}d/;
3042 string = 'aaa,b,c,d';
3043 actualmatch = string.match(pattern);
3044 expectedmatch = Array('aaa,b,c,d', 'c,');
3047 status = inSection(405);
3048 pattern = /^([^,]{1,},){3}d/;
3049 string = 'aaa,b,c,d';
3050 actualmatch = string.match(pattern);
3051 expectedmatch = Array('aaa,b,c,d', 'c,');
3054 status = inSection(406);
3055 pattern = /^([^,]{1,},){3,}d/;
3056 string = 'aaa,b,c,d';
3057 actualmatch = string.match(pattern);
3058 expectedmatch = Array('aaa,b,c,d', 'c,');
3061 status = inSection(407);
3062 pattern = /^([^,]{1,},){0,3}d/;
3063 string = 'aaa,b,c,d';
3064 actualmatch = string.match(pattern);
3065 expectedmatch = Array('aaa,b,c,d', 'c,');
3068 status = inSection(408);
3069 pattern = /^([^,]{0,3},){3}d/i;
3070 string = 'aaa,b,c,d';
3071 actualmatch = string.match(pattern);
3072 expectedmatch = Array('aaa,b,c,d', 'c,');
3075 status = inSection(409);
3076 pattern = /^([^,]{0,3},){3,}d/;
3077 string = 'aaa,b,c,d';
3078 actualmatch = string.match(pattern);
3079 expectedmatch = Array('aaa,b,c,d', 'c,');
3082 status = inSection(410);
3083 pattern = /^([^,]{0,3},){0,3}d/;
3084 string = 'aaa,b,c,d';
3085 actualmatch = string.match(pattern);
3086 expectedmatch = Array('aaa,b,c,d', 'c,');
3089 /* ECMA doesn't support \A
3090 status = inSection(411);
3091 pattern = /(?!\A)x/m;
3093 actualmatch = string.match(pattern);
3094 expectedmatch = Array('\n');
3098 status = inSection(412);
3099 pattern = /^(a(b)?)+$/;
3101 actualmatch = string.match(pattern);
3102 expectedmatch = Array('aba', 'a', undefined);
3105 status = inSection(413);
3106 pattern = /^(aa(bb)?)+$/;
3108 actualmatch = string.match(pattern);
3109 expectedmatch = Array('aabbaa', 'aa', undefined);
3112 status = inSection(414);
3113 pattern = /^.{9}abc.*\n/m;
3114 string = '123\nabcabcabcabc\n';
3115 actualmatch = string.match(pattern);
3116 expectedmatch = Array('abcabcabcabc\n');
3119 status = inSection(415);
3120 pattern = /^(a)?a$/;
3122 actualmatch = string.match(pattern);
3123 expectedmatch = Array('a', undefined);
3126 status = inSection(416);
3127 pattern = /^(a\1?)(a\1?)(a\2?)(a\3?)$/;
3129 actualmatch = string.match(pattern);
3130 expectedmatch = Array('aaaaaa', 'a', 'aa', 'a', 'aa');
3133 /* Can't refer to a capture before it's encountered & completed
3134 status = inSection(417);
3135 pattern = /^(a\1?){4}$/;
3137 actualmatch = string.match(pattern);
3138 expectedmatch = Array('aaaaaa', 'aaa');
3142 status = inSection(418);
3143 pattern = /^(0+)?(?:x(1))?/;
3145 actualmatch = string.match(pattern);
3146 expectedmatch = Array('x1', undefined, '1');
3149 status = inSection(419);
3150 pattern = /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/;
3151 string = '012cxx0190';
3152 actualmatch = string.match(pattern);
3153 expectedmatch = Array('012cxx0190', '012c', undefined, '0190');
3156 status = inSection(420);
3157 pattern = /^(b+?|a){1,2}c/;
3159 actualmatch = string.match(pattern);
3160 expectedmatch = Array('bbbac', 'a');
3163 status = inSection(421);
3164 pattern = /^(b+?|a){1,2}c/;
3166 actualmatch = string.match(pattern);
3167 expectedmatch = Array('bbbbac', 'a');
3170 status = inSection(422);
3171 pattern = /((?:aaaa|bbbb)cccc)?/;
3172 string = 'aaaacccc';
3173 actualmatch = string.match(pattern);
3174 expectedmatch = Array('aaaacccc', 'aaaacccc');
3177 status = inSection(423);
3178 pattern = /((?:aaaa|bbbb)cccc)?/;
3179 string = 'bbbbcccc';
3180 actualmatch = string.match(pattern);
3181 expectedmatch = Array('bbbbcccc', 'bbbbcccc');
3187 //-----------------------------------------------------------------------------
3189 //-----------------------------------------------------------------------------
3195 if(omitCurrentSection())
3198 statusmessages[i] = status;
3199 patterns[i] = pattern;
3200 strings[i] = string;
3201 actualmatches[i] = actualmatch;
3202 expectedmatches[i] = expectedmatch;
3207 function omitCurrentSection()
3211 // current section number is in global status variable
3212 var n = status.match(/(\d+)/)[1];
3213 return ((n < cnLBOUND) || (n > cnUBOUND));
3225 printBugNumber(BUGNUMBER);
3226 printStatus (summary);
3227 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);