]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/mozilla/ecma_3/RegExp/perlstress-001.js
1 /* ***** BEGIN LICENSE BLOCK *****
2 * Version: NPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Netscape Public License
5 * Version 1.1 (the "License"); you may not use this file except in
6 * compliance with the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/NPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Original Code is JavaScript Engine testing utilities.
16 * The Initial Developer of the Original Code is Netscape Communications Corp.
17 * Portions created by the Initial Developer are Copyright (C) 2002
18 * the Initial Developer. All Rights Reserved.
20 * Contributor(s): pschwartau@netscape.com, rogerl@netscape.com
22 * Alternatively, the contents of this file may be used under the terms of
23 * either the GNU General Public License Version 2 or later (the "GPL"), or
24 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
25 * in which case the provisions of the GPL or the LGPL are applicable instead
26 * of those above. If you wish to allow use of your version of this file only
27 * under the terms of either the GPL or the LGPL, and not to allow others to
28 * use your version of this file under the terms of the NPL, indicate your
29 * decision by deleting the provisions above and replace them with the notice
30 * and other provisions required by the GPL or the LGPL. If you do not delete
31 * the provisions above, a recipient may use your version of this file under
32 * the terms of any one of the NPL, the GPL or the LGPL.
34 * ***** END LICENSE BLOCK *****
38 * SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
39 * Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
41 * This test was created by running various patterns and strings through the
42 * Perl 5 RegExp engine. We saved the results below to test the JS engine.
44 * NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
45 * out such sections altogether, or modified them to fit what we expect from JS.
49 * - In JS, regexp captures (/(a) etc./) must hold |undefined| if not used.
50 * See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
51 * By contrast, in Perl, unmatched captures hold the empty string.
52 * We have modified such sections accordingly. Example:
54 pattern = /^([^a-z])|(\^)$/;
56 actualmatch = string.match(pattern);
57 //expectedmatch = Array('.', '.', ''); <<<--- Perl
58 expectedmatch = Array('.', '.', undefined); <<<--- JS
62 * - In JS, you can't refer to a capture before it's encountered & completed
64 * - Perl supports ] & ^] inside a [], ECMA does not
66 * - ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc.
68 * - ECMA doesn't support (?imsx or (?-imsx
70 * - ECMA doesn't support (?(condition)
72 * - Perl has \Z has end-of-line, ECMA doesn't
74 * - In ECMA, ^ matches only the empty string before the first character
76 * - In ECMA, $ matches only the empty string at end of input (unless multiline)
78 * - ECMA spec says that each atom in a range must be a single character
80 * - ECMA doesn't support \A
82 * - ECMA doesn't have rules for [:
85 //-----------------------------------------------------------------------------
88 var summary
= 'Testing regular expression edge cases';
89 var cnSingleSpace
= ' ';
91 var statusmessages
= new Array();
93 var patterns
= new Array();
95 var strings
= new Array();
97 var actualmatches
= new Array();
98 var expectedmatch
= '';
99 var expectedmatches
= new Array();
104 status
= inSection(1);
107 actualmatch
= string
.match(pattern
);
108 expectedmatch
= Array('abc');
111 status
= inSection(2);
114 actualmatch
= string
.match(pattern
);
115 expectedmatch
= Array('abc');
118 status
= inSection(3);
121 actualmatch
= string
.match(pattern
);
122 expectedmatch
= Array('abc');
125 status
= inSection(4);
128 actualmatch
= string
.match(pattern
);
129 expectedmatch
= Array('abc');
132 status
= inSection(5);
135 actualmatch
= string
.match(pattern
);
136 expectedmatch
= Array('abc');
139 status
= inSection(6);
142 actualmatch
= string
.match(pattern
);
143 expectedmatch
= Array('abbc');
146 status
= inSection(7);
149 actualmatch
= string
.match(pattern
);
150 expectedmatch
= Array('abbbbc');
153 status
= inSection(8);
156 actualmatch
= string
.match(pattern
);
157 expectedmatch
= Array('a');
160 status
= inSection(9);
163 actualmatch
= string
.match(pattern
);
164 expectedmatch
= Array('abbb');
167 status
= inSection(10);
168 pattern
= /ab{0,}bc/;
170 actualmatch
= string
.match(pattern
);
171 expectedmatch
= Array('abbbbc');
174 status
= inSection(11);
177 actualmatch
= string
.match(pattern
);
178 expectedmatch
= Array('abbc');
181 status
= inSection(12);
184 actualmatch
= string
.match(pattern
);
185 expectedmatch
= Array('abbbbc');
188 status
= inSection(13);
189 pattern
= /ab{1,}bc/;
191 actualmatch
= string
.match(pattern
);
192 expectedmatch
= Array('abbbbc');
195 status
= inSection(14);
196 pattern
= /ab{1,3}bc/;
198 actualmatch
= string
.match(pattern
);
199 expectedmatch
= Array('abbbbc');
202 status
= inSection(15);
203 pattern
= /ab{3,4}bc/;
205 actualmatch
= string
.match(pattern
);
206 expectedmatch
= Array('abbbbc');
209 status
= inSection(16);
212 actualmatch
= string
.match(pattern
);
213 expectedmatch
= Array('abbc');
216 status
= inSection(17);
219 actualmatch
= string
.match(pattern
);
220 expectedmatch
= Array('abc');
223 status
= inSection(18);
224 pattern
= /ab{0,1}bc/;
226 actualmatch
= string
.match(pattern
);
227 expectedmatch
= Array('abc');
230 status
= inSection(19);
233 actualmatch
= string
.match(pattern
);
234 expectedmatch
= Array('abc');
237 status
= inSection(20);
238 pattern
= /ab{0,1}c/;
240 actualmatch
= string
.match(pattern
);
241 expectedmatch
= Array('abc');
244 status
= inSection(21);
247 actualmatch
= string
.match(pattern
);
248 expectedmatch
= Array('abc');
251 status
= inSection(22);
254 actualmatch
= string
.match(pattern
);
255 expectedmatch
= Array('abc');
258 status
= inSection(23);
261 actualmatch
= string
.match(pattern
);
262 expectedmatch
= Array('abc');
265 status
= inSection(24);
268 actualmatch
= string
.match(pattern
);
269 expectedmatch
= Array('');
272 status
= inSection(25);
275 actualmatch
= string
.match(pattern
);
276 expectedmatch
= Array('');
279 status
= inSection(26);
282 actualmatch
= string
.match(pattern
);
283 expectedmatch
= Array('abc');
286 status
= inSection(27);
289 actualmatch
= string
.match(pattern
);
290 expectedmatch
= Array('axc');
293 status
= inSection(28);
296 actualmatch
= string
.match(pattern
);
297 expectedmatch
= Array('axyzc');
300 status
= inSection(29);
303 actualmatch
= string
.match(pattern
);
304 expectedmatch
= Array('abd');
307 status
= inSection(30);
310 actualmatch
= string
.match(pattern
);
311 expectedmatch
= Array('ace');
314 status
= inSection(31);
317 actualmatch
= string
.match(pattern
);
318 expectedmatch
= Array('ac');
321 status
= inSection(32);
324 actualmatch
= string
.match(pattern
);
325 expectedmatch
= Array('a-');
328 status
= inSection(33);
331 actualmatch
= string
.match(pattern
);
332 expectedmatch
= Array('a-');
335 status
= inSection(34);
338 actualmatch
= string
.match(pattern
);
339 expectedmatch
= Array('a]');
342 /* Perl supports ] & ^] inside a [], ECMA does not
344 status = inSection(35);
346 actualmatch = string.match(pattern);
347 expectedmatch = Array('a]b');
351 status
= inSection(36);
354 actualmatch
= string
.match(pattern
);
355 expectedmatch
= Array('aed');
358 status
= inSection(37);
361 actualmatch
= string
.match(pattern
);
362 expectedmatch
= Array('adc');
365 /* Perl supports ] & ^] inside a [], ECMA does not
366 status = inSection(38);
369 actualmatch = string.match(pattern);
370 expectedmatch = Array('adc');
374 status
= inSection(39);
377 actualmatch
= string
.match(pattern
);
378 expectedmatch
= Array('a');
381 status
= inSection(40);
384 actualmatch
= string
.match(pattern
);
385 expectedmatch
= Array('a');
388 status
= inSection(41);
391 actualmatch
= string
.match(pattern
);
392 expectedmatch
= Array('a');
395 status
= inSection(42);
398 actualmatch
= string
.match(pattern
);
399 expectedmatch
= Array('y');
402 status
= inSection(43);
405 actualmatch
= string
.match(pattern
);
406 expectedmatch
= Array('y');
409 status
= inSection(44);
412 actualmatch
= string
.match(pattern
);
413 expectedmatch
= Array('y');
416 status
= inSection(45);
419 actualmatch
= string
.match(pattern
);
420 expectedmatch
= Array('a');
423 status
= inSection(46);
426 actualmatch
= string
.match(pattern
);
427 expectedmatch
= Array('-');
430 status
= inSection(47);
433 actualmatch
= string
.match(pattern
);
434 expectedmatch
= Array('a-b');
437 status
= inSection(48);
440 actualmatch
= string
.match(pattern
);
441 expectedmatch
= Array('1');
444 status
= inSection(49);
447 actualmatch
= string
.match(pattern
);
448 expectedmatch
= Array('-');
451 status
= inSection(50);
454 actualmatch
= string
.match(pattern
);
455 expectedmatch
= Array('a');
458 status
= inSection(51);
461 actualmatch
= string
.match(pattern
);
462 expectedmatch
= Array('-');
465 status
= inSection(52);
468 actualmatch
= string
.match(pattern
);
469 expectedmatch
= Array('a-b');
472 status
= inSection(53);
475 actualmatch
= string
.match(pattern
);
476 expectedmatch
= Array('1');
479 status
= inSection(54);
482 actualmatch
= string
.match(pattern
);
483 expectedmatch
= Array('-');
486 status
= inSection(55);
489 actualmatch
= string
.match(pattern
);
490 expectedmatch
= Array('ab');
493 status
= inSection(56);
496 actualmatch
= string
.match(pattern
);
497 expectedmatch
= Array('ab');
500 status
= inSection(57);
503 actualmatch
= string
.match(pattern
);
504 expectedmatch
= Array('ef', '');
507 status
= inSection(58);
510 actualmatch
= string
.match(pattern
);
511 expectedmatch
= Array('a(b');
514 status
= inSection(59);
517 actualmatch
= string
.match(pattern
);
518 expectedmatch
= Array('ab');
521 status
= inSection(60);
524 actualmatch
= string
.match(pattern
);
525 expectedmatch
= Array('a((b');
528 status
= inSection(61);
531 actualmatch
= string
.match(pattern
);
532 expectedmatch
= Array('a\\b');
535 status
= inSection(62);
538 actualmatch
= string
.match(pattern
);
539 expectedmatch
= Array('a', 'a', 'a');
542 status
= inSection(63);
545 actualmatch
= string
.match(pattern
);
546 expectedmatch
= Array('abc', 'a', 'c');
549 status
= inSection(64);
552 actualmatch
= string
.match(pattern
);
553 expectedmatch
= Array('abc');
556 status
= inSection(65);
557 pattern
= /a{1,}b{1,}c/;
559 actualmatch
= string
.match(pattern
);
560 expectedmatch
= Array('abc');
563 status
= inSection(66);
566 actualmatch
= string
.match(pattern
);
567 expectedmatch
= Array('abc');
570 status
= inSection(67);
573 actualmatch
= string
.match(pattern
);
574 expectedmatch
= Array('ab', 'b');
577 status
= inSection(68);
578 pattern
= /(a+|b){0,}/;
580 actualmatch
= string
.match(pattern
);
581 expectedmatch
= Array('ab', 'b');
584 status
= inSection(69);
587 actualmatch
= string
.match(pattern
);
588 expectedmatch
= Array('ab', 'b');
591 status
= inSection(70);
592 pattern
= /(a+|b){1,}/;
594 actualmatch
= string
.match(pattern
);
595 expectedmatch
= Array('ab', 'b');
598 status
= inSection(71);
601 actualmatch
= string
.match(pattern
);
602 expectedmatch
= Array('a', 'a');
605 status
= inSection(72);
606 pattern
= /(a+|b){0,1}/;
608 actualmatch
= string
.match(pattern
);
609 expectedmatch
= Array('a', 'a');
612 status
= inSection(73);
615 actualmatch
= string
.match(pattern
);
616 expectedmatch
= Array('cde');
619 status
= inSection(74);
620 pattern
= /([abc])*d/;
622 actualmatch
= string
.match(pattern
);
623 expectedmatch
= Array('abbbcd', 'c');
626 status
= inSection(75);
627 pattern
= /([abc])*bcd/;
629 actualmatch
= string
.match(pattern
);
630 expectedmatch
= Array('abcd', 'a');
633 status
= inSection(76);
634 pattern
= /a|b|c|d|e/;
636 actualmatch
= string
.match(pattern
);
637 expectedmatch
= Array('e');
640 status
= inSection(77);
641 pattern
= /(a|b|c|d|e)f/;
643 actualmatch
= string
.match(pattern
);
644 expectedmatch
= Array('ef', 'e');
647 status
= inSection(78);
648 pattern
= /abcd*efg/;
650 actualmatch
= string
.match(pattern
);
651 expectedmatch
= Array('abcdefg');
654 status
= inSection(79);
656 string
= 'xabyabbbz';
657 actualmatch
= string
.match(pattern
);
658 expectedmatch
= Array('ab');
661 status
= inSection(80);
664 actualmatch
= string
.match(pattern
);
665 expectedmatch
= Array('a');
668 status
= inSection(81);
669 pattern
= /(ab|cd)e/;
671 actualmatch
= string
.match(pattern
);
672 expectedmatch
= Array('cde', 'cd');
675 status
= inSection(82);
676 pattern
= /[abhgefdc]ij/;
678 actualmatch
= string
.match(pattern
);
679 expectedmatch
= Array('hij');
682 status
= inSection(83);
683 pattern
= /(abc|)ef/;
685 actualmatch
= string
.match(pattern
);
686 expectedmatch
= Array('ef', '');
689 status
= inSection(84);
690 pattern
= /(a|b)c*d/;
692 actualmatch
= string
.match(pattern
);
693 expectedmatch
= Array('bcd', 'b');
696 status
= inSection(85);
697 pattern
= /(ab|ab*)bc/;
699 actualmatch
= string
.match(pattern
);
700 expectedmatch
= Array('abc', 'a');
703 status
= inSection(86);
704 pattern
= /a([bc]*)c*/;
706 actualmatch
= string
.match(pattern
);
707 expectedmatch
= Array('abc', 'bc');
710 status
= inSection(87);
711 pattern
= /a([bc]*)(c*d)/;
713 actualmatch
= string
.match(pattern
);
714 expectedmatch
= Array('abcd', 'bc', 'd');
717 status
= inSection(88);
718 pattern
= /a([bc]+)(c*d)/;
720 actualmatch
= string
.match(pattern
);
721 expectedmatch
= Array('abcd', 'bc', 'd');
724 status
= inSection(89);
725 pattern
= /a([bc]*)(c+d)/;
727 actualmatch
= string
.match(pattern
);
728 expectedmatch
= Array('abcd', 'b', 'cd');
731 status
= inSection(90);
732 pattern
= /a[bcd]*dcdcde/;
734 actualmatch
= string
.match(pattern
);
735 expectedmatch
= Array('adcdcde');
738 status
= inSection(91);
739 pattern
= /(ab|a)b*c/;
741 actualmatch
= string
.match(pattern
);
742 expectedmatch
= Array('abc', 'ab');
745 status
= inSection(92);
746 pattern
= /((a)(b)c)(d)/;
748 actualmatch
= string
.match(pattern
);
749 expectedmatch
= Array('abcd', 'abc', 'a', 'b', 'd');
752 status
= inSection(93);
753 pattern
= /[a-zA-Z_][a-zA-Z0-9_]*/;
755 actualmatch
= string
.match(pattern
);
756 expectedmatch
= Array('alpha');
759 status
= inSection(94);
760 pattern
= /^a(bc+|b[eh])g|.h$/;
762 actualmatch
= string
.match(pattern
);
763 expectedmatch
= Array('bh', undefined);
766 status
= inSection(95);
767 pattern
= /(bc+d$|ef*g.|h?i(j|k))/;
769 actualmatch
= string
.match(pattern
);
770 expectedmatch
= Array('effgz', 'effgz', undefined);
773 status
= inSection(96);
774 pattern
= /(bc+d$|ef*g.|h?i(j|k))/;
776 actualmatch
= string
.match(pattern
);
777 expectedmatch
= Array('ij', 'ij', 'j');
780 status
= inSection(97);
781 pattern
= /(bc+d$|ef*g.|h?i(j|k))/;
783 actualmatch
= string
.match(pattern
);
784 expectedmatch
= Array('effgz', 'effgz', undefined);
787 status
= inSection(98);
788 pattern
= /((((((((((a))))))))))/;
790 actualmatch
= string
.match(pattern
);
791 expectedmatch
= Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
794 status
= inSection(99);
795 pattern
= /((((((((((a))))))))))\10/;
797 actualmatch
= string
.match(pattern
);
798 expectedmatch
= Array('aa', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
801 status
= inSection(100);
802 pattern
= /((((((((((a))))))))))/;
804 actualmatch
= string
.match(pattern
);
805 expectedmatch
= Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
808 status
= inSection(101);
809 pattern
= /(((((((((a)))))))))/;
811 actualmatch
= string
.match(pattern
);
812 expectedmatch
= Array('a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a', 'a');
815 status
= inSection(102);
816 pattern
= /(.*)c(.*)/;
818 actualmatch
= string
.match(pattern
);
819 expectedmatch
= Array('abcde', 'ab', 'de');
822 status
= inSection(103);
825 actualmatch
= string
.match(pattern
);
826 expectedmatch
= Array('abcd');
829 status
= inSection(104);
832 actualmatch
= string
.match(pattern
);
833 expectedmatch
= Array('abcd', 'bc');
836 status
= inSection(105);
839 actualmatch
= string
.match(pattern
);
840 expectedmatch
= Array('ac');
843 status
= inSection(106);
846 actualmatch
= string
.match(pattern
);
847 expectedmatch
= Array('abcabc', 'abc');
850 status
= inSection(107);
851 pattern
= /([a-c]*)\1/;
853 actualmatch
= string
.match(pattern
);
854 expectedmatch
= Array('abcabc', 'abc');
857 status
= inSection(108);
860 actualmatch
= string
.match(pattern
);
861 expectedmatch
= Array('a', 'a');
864 status
= inSection(109);
865 pattern
= /(([a-c])b*?\2)*/;
866 string
= 'ababbbcbc';
867 actualmatch
= string
.match(pattern
);
868 expectedmatch
= Array('ababb', 'bb', 'b');
871 status
= inSection(110);
872 pattern
= /(([a-c])b*?\2){3}/;
873 string
= 'ababbbcbc';
874 actualmatch
= string
.match(pattern
);
875 expectedmatch
= Array('ababbbcbc', 'cbc', 'c');
878 /* Can't refer to a capture before it's encountered & completed
879 status = inSection(111);
880 pattern = /((\3|b)\2(a)x)+/;
881 string = 'aaaxabaxbaaxbbax';
882 actualmatch = string.match(pattern);
883 expectedmatch = Array('bbax', 'bbax', 'b', 'a');
886 status = inSection(112);
887 pattern = /((\3|b)\2(a)){2,}/;
888 string = 'bbaababbabaaaaabbaaaabba';
889 actualmatch = string.match(pattern);
890 expectedmatch = Array('bbaaaabba', 'bba', 'b', 'a');
894 status
= inSection(113);
897 actualmatch
= string
.match(pattern
);
898 expectedmatch
= Array('ABC');
901 status
= inSection(114);
904 actualmatch
= string
.match(pattern
);
905 expectedmatch
= Array('ABC');
908 status
= inSection(115);
911 actualmatch
= string
.match(pattern
);
912 expectedmatch
= Array('ABC');
915 status
= inSection(116);
918 actualmatch
= string
.match(pattern
);
919 expectedmatch
= Array('ABC');
922 status
= inSection(117);
925 actualmatch
= string
.match(pattern
);
926 expectedmatch
= Array('ABC');
929 status
= inSection(118);
932 actualmatch
= string
.match(pattern
);
933 expectedmatch
= Array('ABBC');
936 status
= inSection(119);
939 actualmatch
= string
.match(pattern
);
940 expectedmatch
= Array('ABBBBC');
943 status
= inSection(120);
944 pattern
= /ab{0,}?bc/i;
946 actualmatch
= string
.match(pattern
);
947 expectedmatch
= Array('ABBBBC');
950 status
= inSection(121);
953 actualmatch
= string
.match(pattern
);
954 expectedmatch
= Array('ABBC');
957 status
= inSection(122);
960 actualmatch
= string
.match(pattern
);
961 expectedmatch
= Array('ABBBBC');
964 status
= inSection(123);
965 pattern
= /ab{1,}?bc/i;
967 actualmatch
= string
.match(pattern
);
968 expectedmatch
= Array('ABBBBC');
971 status
= inSection(124);
972 pattern
= /ab{1,3}?bc/i;
974 actualmatch
= string
.match(pattern
);
975 expectedmatch
= Array('ABBBBC');
978 status
= inSection(125);
979 pattern
= /ab{3,4}?bc/i;
981 actualmatch
= string
.match(pattern
);
982 expectedmatch
= Array('ABBBBC');
985 status
= inSection(126);
988 actualmatch
= string
.match(pattern
);
989 expectedmatch
= Array('ABBC');
992 status
= inSection(127);
995 actualmatch
= string
.match(pattern
);
996 expectedmatch
= Array('ABC');
999 status
= inSection(128);
1000 pattern
= /ab{0,1}?bc/i;
1002 actualmatch
= string
.match(pattern
);
1003 expectedmatch
= Array('ABC');
1006 status
= inSection(129);
1009 actualmatch
= string
.match(pattern
);
1010 expectedmatch
= Array('ABC');
1013 status
= inSection(130);
1014 pattern
= /ab{0,1}?c/i;
1016 actualmatch
= string
.match(pattern
);
1017 expectedmatch
= Array('ABC');
1020 status
= inSection(131);
1023 actualmatch
= string
.match(pattern
);
1024 expectedmatch
= Array('ABC');
1027 status
= inSection(132);
1030 actualmatch
= string
.match(pattern
);
1031 expectedmatch
= Array('ABC');
1034 status
= inSection(133);
1037 actualmatch
= string
.match(pattern
);
1038 expectedmatch
= Array('ABC');
1041 status
= inSection(134);
1044 actualmatch
= string
.match(pattern
);
1045 expectedmatch
= Array('');
1048 status
= inSection(135);
1051 actualmatch
= string
.match(pattern
);
1052 expectedmatch
= Array('');
1055 status
= inSection(136);
1058 actualmatch
= string
.match(pattern
);
1059 expectedmatch
= Array('ABC');
1062 status
= inSection(137);
1065 actualmatch
= string
.match(pattern
);
1066 expectedmatch
= Array('AXC');
1069 status
= inSection(138);
1072 actualmatch
= string
.match(pattern
);
1073 expectedmatch
= Array('AXYZC');
1076 status
= inSection(139);
1077 pattern
= /a[bc]d/i;
1079 actualmatch
= string
.match(pattern
);
1080 expectedmatch
= Array('ABD');
1083 status
= inSection(140);
1084 pattern
= /a[b-d]e/i;
1086 actualmatch
= string
.match(pattern
);
1087 expectedmatch
= Array('ACE');
1090 status
= inSection(141);
1091 pattern
= /a[b-d]/i;
1093 actualmatch
= string
.match(pattern
);
1094 expectedmatch
= Array('AC');
1097 status
= inSection(142);
1100 actualmatch
= string
.match(pattern
);
1101 expectedmatch
= Array('A-');
1104 status
= inSection(143);
1107 actualmatch
= string
.match(pattern
);
1108 expectedmatch
= Array('A-');
1111 status
= inSection(144);
1114 actualmatch
= string
.match(pattern
);
1115 expectedmatch
= Array('A]');
1118 /* Perl supports ] & ^] inside a [], ECMA does not
1119 status = inSection(145);
1122 actualmatch = string.match(pattern);
1123 expectedmatch = Array('A]B');
1127 status
= inSection(146);
1128 pattern
= /a[^bc]d/i;
1130 actualmatch
= string
.match(pattern
);
1131 expectedmatch
= Array('AED');
1134 status
= inSection(147);
1135 pattern
= /a[^-b]c/i;
1137 actualmatch
= string
.match(pattern
);
1138 expectedmatch
= Array('ADC');
1141 /* Perl supports ] & ^] inside a [], ECMA does not
1142 status = inSection(148);
1143 pattern = /a[^]b]c/i;
1145 actualmatch = string.match(pattern);
1146 expectedmatch = Array('ADC');
1150 status
= inSection(149);
1153 actualmatch
= string
.match(pattern
);
1154 expectedmatch
= Array('AB');
1157 status
= inSection(150);
1160 actualmatch
= string
.match(pattern
);
1161 expectedmatch
= Array('AB');
1164 status
= inSection(151);
1167 actualmatch
= string
.match(pattern
);
1168 expectedmatch
= Array('EF', '');
1171 status
= inSection(152);
1174 actualmatch
= string
.match(pattern
);
1175 expectedmatch
= Array('A(B');
1178 status
= inSection(153);
1181 actualmatch
= string
.match(pattern
);
1182 expectedmatch
= Array('AB');
1185 status
= inSection(154);
1188 actualmatch
= string
.match(pattern
);
1189 expectedmatch
= Array('A((B');
1192 status
= inSection(155);
1195 actualmatch
= string
.match(pattern
);
1196 expectedmatch
= Array('A\\B');
1199 status
= inSection(156);
1202 actualmatch
= string
.match(pattern
);
1203 expectedmatch
= Array('A', 'A', 'A');
1206 status
= inSection(157);
1207 pattern
= /(a)b(c)/i;
1209 actualmatch
= string
.match(pattern
);
1210 expectedmatch
= Array('ABC', 'A', 'C');
1213 status
= inSection(158);
1216 actualmatch
= string
.match(pattern
);
1217 expectedmatch
= Array('ABC');
1220 status
= inSection(159);
1221 pattern
= /a{1,}b{1,}c/i;
1223 actualmatch
= string
.match(pattern
);
1224 expectedmatch
= Array('ABC');
1227 status
= inSection(160);
1230 actualmatch
= string
.match(pattern
);
1231 expectedmatch
= Array('ABC');
1234 status
= inSection(161);
1237 actualmatch
= string
.match(pattern
);
1238 expectedmatch
= Array('ABC');
1241 status
= inSection(162);
1242 pattern
= /a.{0,5}?c/i;
1244 actualmatch
= string
.match(pattern
);
1245 expectedmatch
= Array('ABC');
1248 status
= inSection(163);
1249 pattern
= /(a+|b)*/i;
1251 actualmatch
= string
.match(pattern
);
1252 expectedmatch
= Array('AB', 'B');
1255 status
= inSection(164);
1256 pattern
= /(a+|b){0,}/i;
1258 actualmatch
= string
.match(pattern
);
1259 expectedmatch
= Array('AB', 'B');
1262 status
= inSection(165);
1263 pattern
= /(a+|b)+/i;
1265 actualmatch
= string
.match(pattern
);
1266 expectedmatch
= Array('AB', 'B');
1269 status
= inSection(166);
1270 pattern
= /(a+|b){1,}/i;
1272 actualmatch
= string
.match(pattern
);
1273 expectedmatch
= Array('AB', 'B');
1276 status
= inSection(167);
1277 pattern
= /(a+|b)?/i;
1279 actualmatch
= string
.match(pattern
);
1280 expectedmatch
= Array('A', 'A');
1283 status
= inSection(168);
1284 pattern
= /(a+|b){0,1}/i;
1286 actualmatch
= string
.match(pattern
);
1287 expectedmatch
= Array('A', 'A');
1290 status
= inSection(169);
1291 pattern
= /(a+|b){0,1}?/i;
1293 actualmatch
= string
.match(pattern
);
1294 expectedmatch
= Array('', undefined);
1297 status
= inSection(170);
1298 pattern
= /[^ab]*/i;
1300 actualmatch
= string
.match(pattern
);
1301 expectedmatch
= Array('CDE');
1304 status
= inSection(171);
1305 pattern
= /([abc])*d/i;
1307 actualmatch
= string
.match(pattern
);
1308 expectedmatch
= Array('ABBBCD', 'C');
1311 status
= inSection(172);
1312 pattern
= /([abc])*bcd/i;
1314 actualmatch
= string
.match(pattern
);
1315 expectedmatch
= Array('ABCD', 'A');
1318 status
= inSection(173);
1319 pattern
= /a|b|c|d|e/i;
1321 actualmatch
= string
.match(pattern
);
1322 expectedmatch
= Array('E');
1325 status
= inSection(174);
1326 pattern
= /(a|b|c|d|e)f/i;
1328 actualmatch
= string
.match(pattern
);
1329 expectedmatch
= Array('EF', 'E');
1332 status
= inSection(175);
1333 pattern
= /abcd*efg/i;
1335 actualmatch
= string
.match(pattern
);
1336 expectedmatch
= Array('ABCDEFG');
1339 status
= inSection(176);
1341 string
= 'XABYABBBZ';
1342 actualmatch
= string
.match(pattern
);
1343 expectedmatch
= Array('AB');
1346 status
= inSection(177);
1348 string
= 'XAYABBBZ';
1349 actualmatch
= string
.match(pattern
);
1350 expectedmatch
= Array('A');
1353 status
= inSection(178);
1354 pattern
= /(ab|cd)e/i;
1356 actualmatch
= string
.match(pattern
);
1357 expectedmatch
= Array('CDE', 'CD');
1360 status
= inSection(179);
1361 pattern
= /[abhgefdc]ij/i;
1363 actualmatch
= string
.match(pattern
);
1364 expectedmatch
= Array('HIJ');
1367 status
= inSection(180);
1368 pattern
= /(abc|)ef/i;
1370 actualmatch
= string
.match(pattern
);
1371 expectedmatch
= Array('EF', '');
1374 status
= inSection(181);
1375 pattern
= /(a|b)c*d/i;
1377 actualmatch
= string
.match(pattern
);
1378 expectedmatch
= Array('BCD', 'B');
1381 status
= inSection(182);
1382 pattern
= /(ab|ab*)bc/i;
1384 actualmatch
= string
.match(pattern
);
1385 expectedmatch
= Array('ABC', 'A');
1388 status
= inSection(183);
1389 pattern
= /a([bc]*)c*/i;
1391 actualmatch
= string
.match(pattern
);
1392 expectedmatch
= Array('ABC', 'BC');
1395 status
= inSection(184);
1396 pattern
= /a([bc]*)(c*d)/i;
1398 actualmatch
= string
.match(pattern
);
1399 expectedmatch
= Array('ABCD', 'BC', 'D');
1402 status
= inSection(185);
1403 pattern
= /a([bc]+)(c*d)/i;
1405 actualmatch
= string
.match(pattern
);
1406 expectedmatch
= Array('ABCD', 'BC', 'D');
1409 status
= inSection(186);
1410 pattern
= /a([bc]*)(c+d)/i;
1412 actualmatch
= string
.match(pattern
);
1413 expectedmatch
= Array('ABCD', 'B', 'CD');
1416 status
= inSection(187);
1417 pattern
= /a[bcd]*dcdcde/i;
1419 actualmatch
= string
.match(pattern
);
1420 expectedmatch
= Array('ADCDCDE');
1423 status
= inSection(188);
1424 pattern
= /(ab|a)b*c/i;
1426 actualmatch
= string
.match(pattern
);
1427 expectedmatch
= Array('ABC', 'AB');
1430 status
= inSection(189);
1431 pattern
= /((a)(b)c)(d)/i;
1433 actualmatch
= string
.match(pattern
);
1434 expectedmatch
= Array('ABCD', 'ABC', 'A', 'B', 'D');
1437 status
= inSection(190);
1438 pattern
= /[a-zA-Z_][a-zA-Z0-9_]*/i;
1440 actualmatch
= string
.match(pattern
);
1441 expectedmatch
= Array('ALPHA');
1444 status
= inSection(191);
1445 pattern
= /^a(bc+|b[eh])g|.h$/i;
1447 actualmatch
= string
.match(pattern
);
1448 expectedmatch
= Array('BH', undefined);
1451 status
= inSection(192);
1452 pattern
= /(bc+d$|ef*g.|h?i(j|k))/i;
1454 actualmatch
= string
.match(pattern
);
1455 expectedmatch
= Array('EFFGZ', 'EFFGZ', undefined);
1458 status
= inSection(193);
1459 pattern
= /(bc+d$|ef*g.|h?i(j|k))/i;
1461 actualmatch
= string
.match(pattern
);
1462 expectedmatch
= Array('IJ', 'IJ', 'J');
1465 status
= inSection(194);
1466 pattern
= /(bc+d$|ef*g.|h?i(j|k))/i;
1468 actualmatch
= string
.match(pattern
);
1469 expectedmatch
= Array('EFFGZ', 'EFFGZ', undefined);
1472 status
= inSection(195);
1473 pattern
= /((((((((((a))))))))))/i;
1475 actualmatch
= string
.match(pattern
);
1476 expectedmatch
= Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1479 status
= inSection(196);
1480 pattern
= /((((((((((a))))))))))\10/i;
1482 actualmatch
= string
.match(pattern
);
1483 expectedmatch
= Array('AA', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1486 status
= inSection(197);
1487 pattern
= /((((((((((a))))))))))/i;
1489 actualmatch
= string
.match(pattern
);
1490 expectedmatch
= Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1493 status
= inSection(198);
1494 pattern
= /(((((((((a)))))))))/i;
1496 actualmatch
= string
.match(pattern
);
1497 expectedmatch
= Array('A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A', 'A');
1500 status
= inSection(199);
1501 pattern
= /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))/i;
1503 actualmatch
= string
.match(pattern
);
1504 expectedmatch
= Array('A', 'A');
1507 status
= inSection(200);
1508 pattern
= /(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/i;
1510 actualmatch
= string
.match(pattern
);
1511 expectedmatch
= Array('C', 'C');
1514 status
= inSection(201);
1515 pattern
= /(.*)c(.*)/i;
1517 actualmatch
= string
.match(pattern
);
1518 expectedmatch
= Array('ABCDE', 'AB', 'DE');
1521 status
= inSection(202);
1524 actualmatch
= string
.match(pattern
);
1525 expectedmatch
= Array('ABCD');
1528 status
= inSection(203);
1529 pattern
= /a(bc)d/i;
1531 actualmatch
= string
.match(pattern
);
1532 expectedmatch
= Array('ABCD', 'BC');
1535 status
= inSection(204);
1536 pattern
= /a[-]?c/i;
1538 actualmatch
= string
.match(pattern
);
1539 expectedmatch
= Array('AC');
1542 status
= inSection(205);
1543 pattern
= /(abc)\1/i;
1545 actualmatch
= string
.match(pattern
);
1546 expectedmatch
= Array('ABCABC', 'ABC');
1549 status
= inSection(206);
1550 pattern
= /([a-c]*)\1/i;
1552 actualmatch
= string
.match(pattern
);
1553 expectedmatch
= Array('ABCABC', 'ABC');
1556 status
= inSection(207);
1557 pattern
= /a(?!b)./;
1559 actualmatch
= string
.match(pattern
);
1560 expectedmatch
= Array('ad');
1563 status
= inSection(208);
1564 pattern
= /a(?=d)./;
1566 actualmatch
= string
.match(pattern
);
1567 expectedmatch
= Array('ad');
1570 status
= inSection(209);
1571 pattern
= /a(?=c|d)./;
1573 actualmatch
= string
.match(pattern
);
1574 expectedmatch
= Array('ad');
1577 status
= inSection(210);
1578 pattern
= /a(?:b|c|d)(.)/;
1580 actualmatch
= string
.match(pattern
);
1581 expectedmatch
= Array('ace', 'e');
1584 status
= inSection(211);
1585 pattern
= /a(?:b|c|d)*(.)/;
1587 actualmatch
= string
.match(pattern
);
1588 expectedmatch
= Array('ace', 'e');
1591 status
= inSection(212);
1592 pattern
= /a(?:b|c|d)+?(.)/;
1594 actualmatch
= string
.match(pattern
);
1595 expectedmatch
= Array('ace', 'e');
1598 status
= inSection(213);
1599 pattern
= /a(?:b|c|d)+?(.)/;
1600 string
= 'acdbcdbe';
1601 actualmatch
= string
.match(pattern
);
1602 expectedmatch
= Array('acd', 'd');
1605 status
= inSection(214);
1606 pattern
= /a(?:b|c|d)+(.)/;
1607 string
= 'acdbcdbe';
1608 actualmatch
= string
.match(pattern
);
1609 expectedmatch
= Array('acdbcdbe', 'e');
1612 status
= inSection(215);
1613 pattern
= /a(?:b|c|d){2}(.)/;
1614 string
= 'acdbcdbe';
1615 actualmatch
= string
.match(pattern
);
1616 expectedmatch
= Array('acdb', 'b');
1619 status
= inSection(216);
1620 pattern
= /a(?:b|c|d){4,5}(.)/;
1621 string
= 'acdbcdbe';
1622 actualmatch
= string
.match(pattern
);
1623 expectedmatch
= Array('acdbcdb', 'b');
1626 status
= inSection(217);
1627 pattern
= /a(?:b|c|d){4,5}?(.)/;
1628 string
= 'acdbcdbe';
1629 actualmatch
= string
.match(pattern
);
1630 expectedmatch
= Array('acdbcd', 'd');
1633 // MODIFIED - ECMA has different rules for paren contents
1634 status
= inSection(218);
1635 pattern
= /((foo)|(bar))*/;
1637 actualmatch
= string
.match(pattern
);
1638 //expectedmatch = Array('foobar', 'bar', 'foo', 'bar');
1639 expectedmatch
= Array('foobar', 'bar', undefined, 'bar');
1642 status
= inSection(219);
1643 pattern
= /a(?:b|c|d){6,7}(.)/;
1644 string
= 'acdbcdbe';
1645 actualmatch
= string
.match(pattern
);
1646 expectedmatch
= Array('acdbcdbe', 'e');
1649 status
= inSection(220);
1650 pattern
= /a(?:b|c|d){6,7}?(.)/;
1651 string
= 'acdbcdbe';
1652 actualmatch
= string
.match(pattern
);
1653 expectedmatch
= Array('acdbcdbe', 'e');
1656 status
= inSection(221);
1657 pattern
= /a(?:b|c|d){5,6}(.)/;
1658 string
= 'acdbcdbe';
1659 actualmatch
= string
.match(pattern
);
1660 expectedmatch
= Array('acdbcdbe', 'e');
1663 status
= inSection(222);
1664 pattern
= /a(?:b|c|d){5,6}?(.)/;
1665 string
= 'acdbcdbe';
1666 actualmatch
= string
.match(pattern
);
1667 expectedmatch
= Array('acdbcdb', 'b');
1670 status
= inSection(223);
1671 pattern
= /a(?:b|c|d){5,7}(.)/;
1672 string
= 'acdbcdbe';
1673 actualmatch
= string
.match(pattern
);
1674 expectedmatch
= Array('acdbcdbe', 'e');
1677 status
= inSection(224);
1678 pattern
= /a(?:b|c|d){5,7}?(.)/;
1679 string
= 'acdbcdbe';
1680 actualmatch
= string
.match(pattern
);
1681 expectedmatch
= Array('acdbcdb', 'b');
1684 status
= inSection(225);
1685 pattern
= /a(?:b|(c|e){1,2}?|d)+?(.)/;
1687 actualmatch
= string
.match(pattern
);
1688 expectedmatch
= Array('ace', 'c', 'e');
1691 status
= inSection(226);
1692 pattern
= /^(.+)?B/;
1694 actualmatch
= string
.match(pattern
);
1695 expectedmatch
= Array('AB', 'A');
1698 /* MODIFIED - ECMA has different rules for paren contents */
1699 status
= inSection(227);
1700 pattern
= /^([^a-z])|(\^)$/;
1702 actualmatch
= string
.match(pattern
);
1703 //expectedmatch = Array('.', '.', '');
1704 expectedmatch
= Array('.', '.', undefined);
1707 status
= inSection(228);
1710 actualmatch
= string
.match(pattern
);
1711 expectedmatch
= Array('<&');
1714 /* Can't refer to a capture before it's encountered & completed
1715 status = inSection(229);
1716 pattern = /^(a\1?){4}$/;
1717 string = 'aaaaaaaaaa';
1718 actualmatch = string.match(pattern);
1719 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1722 status = inSection(230);
1723 pattern = /^(a(?(1)\1)){4}$/;
1724 string = 'aaaaaaaaaa';
1725 actualmatch = string.match(pattern);
1726 expectedmatch = Array('aaaaaaaaaa', 'aaaa');
1730 status
= inSection(231);
1731 pattern
= /((a{4})+)/;
1732 string
= 'aaaaaaaaa';
1733 actualmatch
= string
.match(pattern
);
1734 expectedmatch
= Array('aaaaaaaa', 'aaaaaaaa', 'aaaa');
1737 status
= inSection(232);
1738 pattern
= /(((aa){2})+)/;
1739 string
= 'aaaaaaaaaa';
1740 actualmatch
= string
.match(pattern
);
1741 expectedmatch
= Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1744 status
= inSection(233);
1745 pattern
= /(((a{2}){2})+)/;
1746 string
= 'aaaaaaaaaa';
1747 actualmatch
= string
.match(pattern
);
1748 expectedmatch
= Array('aaaaaaaa', 'aaaaaaaa', 'aaaa', 'aa');
1751 status
= inSection(234);
1752 pattern
= /(?:(f)(o)(o)|(b)(a)(r))*/;
1754 actualmatch
= string
.match(pattern
);
1755 //expectedmatch = Array('foobar', 'f', 'o', 'o', 'b', 'a', 'r');
1756 expectedmatch
= Array('foobar', undefined, undefined, undefined, 'b', 'a', 'r');
1759 /* ECMA supports (?: (?= and (?! but doesn't support (?< etc.
1760 status = inSection(235);
1761 pattern = /(?<=a)b/;
1763 actualmatch = string.match(pattern);
1764 expectedmatch = Array('b');
1767 status = inSection(236);
1768 pattern = /(?<!c)b/;
1770 actualmatch = string.match(pattern);
1771 expectedmatch = Array('b');
1774 status = inSection(237);
1775 pattern = /(?<!c)b/;
1777 actualmatch = string.match(pattern);
1778 expectedmatch = Array('b');
1781 status = inSection(238);
1782 pattern = /(?<!c)b/;
1784 actualmatch = string.match(pattern);
1785 expectedmatch = Array('b');
1789 status
= inSection(239);
1790 pattern
= /(?:..)*a/;
1792 actualmatch
= string
.match(pattern
);
1793 expectedmatch
= Array('aba');
1796 status
= inSection(240);
1797 pattern
= /(?:..)*?a/;
1799 actualmatch
= string
.match(pattern
);
1800 expectedmatch
= Array('a');
1804 * MODIFIED - ECMA has different rules for paren contents. Note
1805 * this regexp has two non-capturing parens, and one capturing
1807 * The issue: shouldn't the match be ['ab', undefined]? Because the
1808 * '\1' matches the undefined value of the second iteration of the '*'
1809 * (in which the 'b' part of the '|' matches). But Perl wants ['ab','b'].
1811 * Answer: waldemar@netscape.com:
1813 * The correct answer is ['ab', undefined]. Perl doesn't match
1814 * ECMAScript here, and I'd say that Perl is wrong in this case.
1816 status
= inSection(241);
1817 pattern
= /^(?:b|a(?=(.)))*\1/;
1819 actualmatch
= string
.match(pattern
);
1820 //expectedmatch = Array('ab', 'b');
1821 expectedmatch
= Array('ab', undefined);
1824 status
= inSection(242);
1825 pattern
= /^(){3,5}/;
1827 actualmatch
= string
.match(pattern
);
1828 expectedmatch
= Array('', '');
1831 status
= inSection(243);
1832 pattern
= /^(a+)*ax/;
1834 actualmatch
= string
.match(pattern
);
1835 expectedmatch
= Array('aax', 'a');
1838 status
= inSection(244);
1839 pattern
= /^((a|b)+)*ax/;
1841 actualmatch
= string
.match(pattern
);
1842 expectedmatch
= Array('aax', 'a', 'a');
1845 status
= inSection(245);
1846 pattern
= /^((a|bc)+)*ax/;
1848 actualmatch
= string
.match(pattern
);
1849 expectedmatch
= Array('aax', 'a', 'a');
1852 /* MODIFIED - ECMA has different rules for paren contents */
1853 status
= inSection(246);
1854 pattern
= /(a|x)*ab/;
1856 actualmatch
= string
.match(pattern
);
1857 //expectedmatch = Array('ab', '');
1858 expectedmatch
= Array('ab', undefined);
1861 status
= inSection(247);
1864 actualmatch
= string
.match(pattern
);
1865 expectedmatch
= Array('ab', undefined);
1868 /* ECMA doesn't support (?imsx or (?-imsx
1869 status = inSection(248);
1870 pattern = /(?:(?i)a)b/;
1872 actualmatch = string.match(pattern);
1873 expectedmatch = Array('ab');
1876 status = inSection(249);
1877 pattern = /((?i)a)b/;
1879 actualmatch = string.match(pattern);
1880 expectedmatch = Array('ab', 'a');
1883 status = inSection(250);
1884 pattern = /(?:(?i)a)b/;
1886 actualmatch = string.match(pattern);
1887 expectedmatch = Array('Ab');
1890 status = inSection(251);
1891 pattern = /((?i)a)b/;
1893 actualmatch = string.match(pattern);
1894 expectedmatch = Array('Ab', 'A');
1897 status = inSection(252);
1898 pattern = /(?i:a)b/;
1900 actualmatch = string.match(pattern);
1901 expectedmatch = Array('ab');
1904 status = inSection(253);
1905 pattern = /((?i:a))b/;
1907 actualmatch = string.match(pattern);
1908 expectedmatch = Array('ab', 'a');
1911 status = inSection(254);
1912 pattern = /(?i:a)b/;
1914 actualmatch = string.match(pattern);
1915 expectedmatch = Array('Ab');
1918 status = inSection(255);
1919 pattern = /((?i:a))b/;
1921 actualmatch = string.match(pattern);
1922 expectedmatch = Array('Ab', 'A');
1925 status = inSection(256);
1926 pattern = /(?:(?-i)a)b/i;
1928 actualmatch = string.match(pattern);
1929 expectedmatch = Array('ab');
1932 status = inSection(257);
1933 pattern = /((?-i)a)b/i;
1935 actualmatch = string.match(pattern);
1936 expectedmatch = Array('ab', 'a');
1939 status = inSection(258);
1940 pattern = /(?:(?-i)a)b/i;
1942 actualmatch = string.match(pattern);
1943 expectedmatch = Array('aB');
1946 status = inSection(259);
1947 pattern = /((?-i)a)b/i;
1949 actualmatch = string.match(pattern);
1950 expectedmatch = Array('aB', 'a');
1953 status = inSection(260);
1954 pattern = /(?:(?-i)a)b/i;
1956 actualmatch = string.match(pattern);
1957 expectedmatch = Array('aB');
1960 status = inSection(261);
1961 pattern = /((?-i)a)b/i;
1963 actualmatch = string.match(pattern);
1964 expectedmatch = Array('aB', 'a');
1967 status = inSection(262);
1968 pattern = /(?-i:a)b/i;
1970 actualmatch = string.match(pattern);
1971 expectedmatch = Array('ab');
1974 status = inSection(263);
1975 pattern = /((?-i:a))b/i;
1977 actualmatch = string.match(pattern);
1978 expectedmatch = Array('ab', 'a');
1981 status = inSection(264);
1982 pattern = /(?-i:a)b/i;
1984 actualmatch = string.match(pattern);
1985 expectedmatch = Array('aB');
1988 status = inSection(265);
1989 pattern = /((?-i:a))b/i;
1991 actualmatch = string.match(pattern);
1992 expectedmatch = Array('aB', 'a');
1995 status = inSection(266);
1996 pattern = /(?-i:a)b/i;
1998 actualmatch = string.match(pattern);
1999 expectedmatch = Array('aB');
2002 status = inSection(267);
2003 pattern = /((?-i:a))b/i;
2005 actualmatch = string.match(pattern);
2006 expectedmatch = Array('aB', 'a');
2009 status = inSection(268);
2010 pattern = /((?s-i:a.))b/i;
2012 actualmatch = string.match(pattern);
2013 expectedmatch = Array('a\nB', 'a\n');
2017 status
= inSection(269);
2018 pattern
= /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/;
2020 actualmatch
= string
.match(pattern
);
2021 expectedmatch
= Array('cabbbb');
2024 status
= inSection(270);
2025 pattern
= /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/;
2026 string
= 'caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
2027 actualmatch
= string
.match(pattern
);
2028 expectedmatch
= Array('caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
2031 status
= inSection(271);
2032 pattern
= /(ab)\d\1/i;
2034 actualmatch
= string
.match(pattern
);
2035 expectedmatch
= Array('Ab4ab', 'Ab');
2038 status
= inSection(272);
2039 pattern
= /(ab)\d\1/i;
2041 actualmatch
= string
.match(pattern
);
2042 expectedmatch
= Array('ab4Ab', 'ab');
2045 status
= inSection(273);
2046 pattern
= /foo\w*\d{4}baz/;
2047 string
= 'foobar1234baz';
2048 actualmatch
= string
.match(pattern
);
2049 expectedmatch
= Array('foobar1234baz');
2052 status
= inSection(274);
2053 pattern
= /x(~~)*(?:(?:F)?)?/;
2055 actualmatch
= string
.match(pattern
);
2056 expectedmatch
= Array('x~~', '~~');
2059 /* Perl supports (?# but JS doesn't
2060 status = inSection(275);
2061 pattern = /^a(?#xxx){3}c/;
2063 actualmatch = string.match(pattern);
2064 expectedmatch = Array('aaac');
2068 /* ECMA doesn't support (?< etc
2069 status = inSection(276);
2070 pattern = /(?<![cd])[ab]/;
2072 actualmatch = string.match(pattern);
2073 expectedmatch = Array('a');
2076 status = inSection(277);
2077 pattern = /(?<!(c|d))[ab]/;
2079 actualmatch = string.match(pattern);
2080 expectedmatch = Array('a');
2083 status = inSection(278);
2084 pattern = /(?<!cd)[ab]/;
2086 actualmatch = string.match(pattern);
2087 expectedmatch = Array('b');
2090 status = inSection(279);
2091 pattern = /((?s)^a(.))((?m)^b$)/;
2092 string = 'a\nb\nc\n';
2093 actualmatch = string.match(pattern);
2094 expectedmatch = Array('a\nb', 'a\n', '\n', 'b');
2097 status = inSection(280);
2098 pattern = /((?m)^b$)/;
2099 string = 'a\nb\nc\n';
2100 actualmatch = string.match(pattern);
2101 expectedmatch = Array('b', 'b');
2104 status = inSection(281);
2107 actualmatch = string.match(pattern);
2108 expectedmatch = Array('b');
2111 status = inSection(282);
2112 pattern = /(?m)^(b)/;
2114 actualmatch = string.match(pattern);
2115 expectedmatch = Array('b', 'b');
2118 status = inSection(283);
2119 pattern = /((?m)^b)/;
2121 actualmatch = string.match(pattern);
2122 expectedmatch = Array('b', 'b');
2125 status = inSection(284);
2126 pattern = /\n((?m)^b)/;
2128 actualmatch = string.match(pattern);
2129 expectedmatch = Array('\nb', 'b');
2132 status = inSection(285);
2133 pattern = /((?s).)c(?!.)/;
2134 string = 'a\nb\nc\n';
2135 actualmatch = string.match(pattern);
2136 expectedmatch = Array('\nc', '\n');
2139 status = inSection(286);
2140 pattern = /((?s).)c(?!.)/;
2141 string = 'a\nb\nc\n';
2142 actualmatch = string.match(pattern);
2143 expectedmatch = Array('\nc', '\n');
2146 status = inSection(287);
2147 pattern = /((?s)b.)c(?!.)/;
2148 string = 'a\nb\nc\n';
2149 actualmatch = string.match(pattern);
2150 expectedmatch = Array('b\nc', 'b\n');
2153 status = inSection(288);
2154 pattern = /((?s)b.)c(?!.)/;
2155 string = 'a\nb\nc\n';
2156 actualmatch = string.match(pattern);
2157 expectedmatch = Array('b\nc', 'b\n');
2160 status = inSection(289);
2161 pattern = /((?m)^b)/;
2162 string = 'a\nb\nc\n';
2163 actualmatch = string.match(pattern);
2164 expectedmatch = Array('b', 'b');
2168 /* ECMA doesn't support (?(condition)
2169 status = inSection(290);
2170 pattern = /(?(1)b|a)/;
2172 actualmatch = string.match(pattern);
2173 expectedmatch = Array('a');
2176 status = inSection(291);
2177 pattern = /(x)?(?(1)b|a)/;
2179 actualmatch = string.match(pattern);
2180 expectedmatch = Array('a');
2183 status = inSection(292);
2184 pattern = /()?(?(1)b|a)/;
2186 actualmatch = string.match(pattern);
2187 expectedmatch = Array('a');
2190 status = inSection(293);
2191 pattern = /()?(?(1)a|b)/;
2193 actualmatch = string.match(pattern);
2194 expectedmatch = Array('a');
2197 status = inSection(294);
2198 pattern = /^(\()?blah(?(1)(\)))$/;
2200 actualmatch = string.match(pattern);
2201 expectedmatch = Array('(blah)', '(', ')');
2204 status = inSection(295);
2205 pattern = /^(\()?blah(?(1)(\)))$/;
2207 actualmatch = string.match(pattern);
2208 expectedmatch = Array('blah');
2211 status = inSection(296);
2212 pattern = /^(\(+)?blah(?(1)(\)))$/;
2214 actualmatch = string.match(pattern);
2215 expectedmatch = Array('(blah)', '(', ')');
2218 status = inSection(297);
2219 pattern = /^(\(+)?blah(?(1)(\)))$/;
2221 actualmatch = string.match(pattern);
2222 expectedmatch = Array('blah');
2225 status = inSection(298);
2226 pattern = /(?(?!a)b|a)/;
2228 actualmatch = string.match(pattern);
2229 expectedmatch = Array('a');
2232 status = inSection(299);
2233 pattern = /(?(?=a)a|b)/;
2235 actualmatch = string.match(pattern);
2236 expectedmatch = Array('a');
2240 status
= inSection(300);
2241 pattern
= /(?=(a+?))(\1ab)/;
2243 actualmatch
= string
.match(pattern
);
2244 expectedmatch
= Array('aab', 'a', 'aab');
2247 status
= inSection(301);
2248 pattern
= /(\w+:)+/;
2250 actualmatch
= string
.match(pattern
);
2251 expectedmatch
= Array('one:', 'one:');
2254 /* ECMA doesn't support (?< etc
2255 status = inSection(302);
2256 pattern = /$(?<=^(a))/;
2258 actualmatch = string.match(pattern);
2259 expectedmatch = Array('', 'a');
2263 status
= inSection(303);
2264 pattern
= /(?=(a+?))(\1ab)/;
2266 actualmatch
= string
.match(pattern
);
2267 expectedmatch
= Array('aab', 'a', 'aab');
2270 /* MODIFIED - ECMA has different rules for paren contents */
2271 status
= inSection(304);
2272 pattern
= /([\w:]+::)?(\w+)$/;
2274 actualmatch
= string
.match(pattern
);
2275 //expectedmatch = Array('abcd', '', 'abcd');
2276 expectedmatch
= Array('abcd', undefined, 'abcd');
2279 status
= inSection(305);
2280 pattern
= /([\w:]+::)?(\w+)$/;
2281 string
= 'xy:z:::abcd';
2282 actualmatch
= string
.match(pattern
);
2283 expectedmatch
= Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2286 status
= inSection(306);
2287 pattern
= /^[^bcd]*(c+)/;
2289 actualmatch
= string
.match(pattern
);
2290 expectedmatch
= Array('aexyc', 'c');
2293 status
= inSection(307);
2296 actualmatch
= string
.match(pattern
);
2297 expectedmatch
= Array('aab', 'aa');
2300 /* MODIFIED - ECMA has different rules for paren contents */
2301 status
= inSection(308);
2302 pattern
= /([\w:]+::)?(\w+)$/;
2304 actualmatch
= string
.match(pattern
);
2305 //expectedmatch = Array('abcd', '', 'abcd');
2306 expectedmatch
= Array('abcd', undefined, 'abcd');
2309 status
= inSection(309);
2310 pattern
= /([\w:]+::)?(\w+)$/;
2311 string
= 'xy:z:::abcd';
2312 actualmatch
= string
.match(pattern
);
2313 expectedmatch
= Array('xy:z:::abcd', 'xy:z:::', 'abcd');
2316 status
= inSection(310);
2317 pattern
= /^[^bcd]*(c+)/;
2319 actualmatch
= string
.match(pattern
);
2320 expectedmatch
= Array('aexyc', 'c');
2323 /* ECMA doesn't support (?>
2324 status = inSection(311);
2325 pattern = /(?>a+)b/;
2327 actualmatch = string.match(pattern);
2328 expectedmatch = Array('aaab');
2332 status
= inSection(312);
2333 pattern
= /([[:]+)/;
2335 actualmatch
= string
.match(pattern
);
2336 expectedmatch
= Array(':[', ':[');
2339 status
= inSection(313);
2340 pattern
= /([[=]+)/;
2342 actualmatch
= string
.match(pattern
);
2343 expectedmatch
= Array('=[', '=[');
2346 status
= inSection(314);
2347 pattern
= /([[.]+)/;
2349 actualmatch
= string
.match(pattern
);
2350 expectedmatch
= Array('.[', '.[');
2353 /* ECMA doesn't have rules for [:
2354 status = inSection(315);
2355 pattern = /[a[:]b[:c]/;
2357 actualmatch = string.match(pattern);
2358 expectedmatch = Array('abc');
2362 /* ECMA doesn't support (?>
2363 status = inSection(316);
2364 pattern = /((?>a+)b)/;
2366 actualmatch = string.match(pattern);
2367 expectedmatch = Array('aaab', 'aaab');
2370 status = inSection(317);
2371 pattern = /(?>(a+))b/;
2373 actualmatch = string.match(pattern);
2374 expectedmatch = Array('aaab', 'aaa');
2377 status = inSection(318);
2378 pattern = /((?>[^()]+)|\([^()]*\))+/;
2379 string = '((abc(ade)ufh()()x';
2380 actualmatch = string.match(pattern);
2381 expectedmatch = Array('abc(ade)ufh()()x', 'x');
2385 /* Perl has \Z has end-of-line, ECMA doesn't
2386 status = inSection(319);
2389 actualmatch = string.match(pattern);
2390 expectedmatch = Array('');
2393 status = inSection(320);
2396 actualmatch = string.match(pattern);
2397 expectedmatch = Array('');
2401 status
= inSection(321);
2404 actualmatch
= string
.match(pattern
);
2405 expectedmatch
= Array('');
2408 /* Perl has \Z has end-of-line, ECMA doesn't
2409 status = inSection(322);
2412 actualmatch = string.match(pattern);
2413 expectedmatch = Array('');
2416 status = inSection(323);
2419 actualmatch = string.match(pattern);
2420 expectedmatch = Array('');
2424 status
= inSection(324);
2427 actualmatch
= string
.match(pattern
);
2428 expectedmatch
= Array('');
2431 /* Perl has \Z has end-of-line, ECMA doesn't
2432 status = inSection(325);
2435 actualmatch = string.match(pattern);
2436 expectedmatch = Array('');
2439 status = inSection(326);
2442 actualmatch = string.match(pattern);
2443 expectedmatch = Array('');
2447 status
= inSection(327);
2450 actualmatch
= string
.match(pattern
);
2451 expectedmatch
= Array('');
2454 /* Perl has \Z has end-of-line, ECMA doesn't
2455 status = inSection(328);
2458 actualmatch = string.match(pattern);
2459 expectedmatch = Array('');
2462 status = inSection(329);
2465 actualmatch = string.match(pattern);
2466 expectedmatch = Array('');
2470 status
= inSection(330);
2473 actualmatch
= string
.match(pattern
);
2474 expectedmatch
= Array('');
2477 /* Perl has \Z has end-of-line, ECMA doesn't
2478 status = inSection(331);
2481 actualmatch = string.match(pattern);
2482 expectedmatch = Array('');
2485 status = inSection(332);
2488 actualmatch = string.match(pattern);
2489 expectedmatch = Array('');
2493 status
= inSection(333);
2496 actualmatch
= string
.match(pattern
);
2497 expectedmatch
= Array('');
2500 /* Perl has \Z has end-of-line, ECMA doesn't
2501 status = inSection(334);
2504 actualmatch = string.match(pattern);
2505 expectedmatch = Array('');
2508 status = inSection(335);
2511 actualmatch = string.match(pattern);
2512 expectedmatch = Array('');
2516 status
= inSection(336);
2519 actualmatch
= string
.match(pattern
);
2520 expectedmatch
= Array('');
2523 /* Perl has \Z has end-of-line, ECMA doesn't
2524 status = inSection(337);
2527 actualmatch = string.match(pattern);
2528 expectedmatch = Array('a');
2532 /* $ only matches end of input unless multiline
2533 status = inSection(338);
2536 actualmatch = string.match(pattern);
2537 expectedmatch = Array('a');
2541 /* Perl has \Z has end-of-line, ECMA doesn't
2542 status = inSection(339);
2545 actualmatch = string.match(pattern);
2546 expectedmatch = Array('a');
2549 status = inSection(340);
2552 actualmatch = string.match(pattern);
2553 expectedmatch = Array('a');
2557 status
= inSection(341);
2560 actualmatch
= string
.match(pattern
);
2561 expectedmatch
= Array('a');
2564 status
= inSection(342);
2567 actualmatch
= string
.match(pattern
);
2568 expectedmatch
= Array('a');
2571 /* Perl has \Z has end-of-line, ECMA doesn't
2572 status = inSection(343);
2575 actualmatch = string.match(pattern);
2576 expectedmatch = Array('a');
2580 status
= inSection(344);
2583 actualmatch
= string
.match(pattern
);
2584 expectedmatch
= Array('a');
2587 /* Perl has \Z has end-of-line, ECMA doesn't
2588 status = inSection(345);
2591 actualmatch = string.match(pattern);
2592 expectedmatch = Array('a');
2595 status = inSection(346);
2598 actualmatch = string.match(pattern);
2599 expectedmatch = Array('a');
2603 status
= inSection(347);
2606 actualmatch
= string
.match(pattern
);
2607 expectedmatch
= Array('a');
2610 /* Perl has \Z has end-of-line, ECMA doesn't
2611 status = inSection(348);
2614 actualmatch = string.match(pattern);
2615 expectedmatch = Array('aa');
2619 /* $ only matches end of input unless multiline
2620 status = inSection(349);
2623 actualmatch = string.match(pattern);
2624 expectedmatch = Array('aa');
2628 /* Perl has \Z has end-of-line, ECMA doesn't
2629 status = inSection(350);
2632 actualmatch = string.match(pattern);
2633 expectedmatch = Array('aa');
2636 status = inSection(351);
2639 actualmatch = string.match(pattern);
2640 expectedmatch = Array('aa');
2644 status
= inSection(352);
2647 actualmatch
= string
.match(pattern
);
2648 expectedmatch
= Array('aa');
2651 status
= inSection(353);
2654 actualmatch
= string
.match(pattern
);
2655 expectedmatch
= Array('aa');
2658 /* Perl has \Z has end-of-line, ECMA doesn't
2659 status = inSection(354);
2662 actualmatch = string.match(pattern);
2663 expectedmatch = Array('aa');
2667 status
= inSection(355);
2670 actualmatch
= string
.match(pattern
);
2671 expectedmatch
= Array('aa');
2674 /* Perl has \Z has end-of-line, ECMA doesn't
2675 status = inSection(356);
2678 actualmatch = string.match(pattern);
2679 expectedmatch = Array('aa');
2682 status = inSection(357);
2685 actualmatch = string.match(pattern);
2686 expectedmatch = Array('aa');
2690 status
= inSection(358);
2693 actualmatch
= string
.match(pattern
);
2694 expectedmatch
= Array('aa');
2697 /* Perl has \Z has end-of-line, ECMA doesn't
2698 status = inSection(359);
2701 actualmatch = string.match(pattern);
2702 expectedmatch = Array('ab');
2706 /* $ only matches end of input unless multiline
2707 status = inSection(360);
2710 actualmatch = string.match(pattern);
2711 expectedmatch = Array('ab');
2715 /* Perl has \Z has end-of-line, ECMA doesn't
2716 status = inSection(361);
2719 actualmatch = string.match(pattern);
2720 expectedmatch = Array('ab');
2723 status = inSection(362);
2726 actualmatch = string.match(pattern);
2727 expectedmatch = Array('ab');
2731 status
= inSection(363);
2734 actualmatch
= string
.match(pattern
);
2735 expectedmatch
= Array('ab');
2738 status
= inSection(364);
2741 actualmatch
= string
.match(pattern
);
2742 expectedmatch
= Array('ab');
2745 /* Perl has \Z has end-of-line, ECMA doesn't
2746 status = inSection(365);
2749 actualmatch = string.match(pattern);
2750 expectedmatch = Array('ab');
2754 status
= inSection(366);
2757 actualmatch
= string
.match(pattern
);
2758 expectedmatch
= Array('ab');
2761 /* Perl has \Z has end-of-line, ECMA doesn't
2762 status = inSection(367);
2765 actualmatch = string.match(pattern);
2766 expectedmatch = Array('ab');
2769 status = inSection(368);
2772 actualmatch = string.match(pattern);
2773 expectedmatch = Array('ab');
2777 status
= inSection(369);
2780 actualmatch
= string
.match(pattern
);
2781 expectedmatch
= Array('ab');
2784 /* Perl has \Z has end-of-line, ECMA doesn't
2785 status = inSection(370);
2787 string = 'b\nabb\n';
2788 actualmatch = string.match(pattern);
2789 expectedmatch = Array('abb');
2793 /* $ only matches end of input unless multiline
2794 status = inSection(371);
2796 string = 'b\nabb\n';
2797 actualmatch = string.match(pattern);
2798 expectedmatch = Array('abb');
2802 /* Perl has \Z has end-of-line, ECMA doesn't
2803 status = inSection(372);
2806 actualmatch = string.match(pattern);
2807 expectedmatch = Array('abb');
2810 status = inSection(373);
2813 actualmatch = string.match(pattern);
2814 expectedmatch = Array('abb');
2818 status
= inSection(374);
2821 actualmatch
= string
.match(pattern
);
2822 expectedmatch
= Array('abb');
2825 status
= inSection(375);
2827 string
= 'abb\nb\n';
2828 actualmatch
= string
.match(pattern
);
2829 expectedmatch
= Array('abb');
2832 /* Perl has \Z has end-of-line, ECMA doesn't
2833 status = inSection(376);
2835 string = 'b\nabb\n';
2836 actualmatch = string.match(pattern);
2837 expectedmatch = Array('abb');
2841 status
= inSection(377);
2843 string
= 'b\nabb\n';
2844 actualmatch
= string
.match(pattern
);
2845 expectedmatch
= Array('abb');
2848 /* Perl has \Z has end-of-line, ECMA doesn't
2849 status = inSection(378);
2852 actualmatch = string.match(pattern);
2853 expectedmatch = Array('abb');
2856 status = inSection(379);
2859 actualmatch = string.match(pattern);
2860 expectedmatch = Array('abb');
2864 status
= inSection(380);
2867 actualmatch
= string
.match(pattern
);
2868 expectedmatch
= Array('abb');
2871 status
= inSection(381);
2872 pattern
= /(^|x)(c)/;
2874 actualmatch
= string
.match(pattern
);
2875 expectedmatch
= Array('c', '', 'c');
2878 status
= inSection(382);
2879 pattern
= /foo.bart/;
2880 string
= 'foo.bart';
2881 actualmatch
= string
.match(pattern
);
2882 expectedmatch
= Array('foo.bart');
2885 status
= inSection(383);
2886 pattern
= /^d[x][x][x]/m;
2887 string
= 'abcd\ndxxx';
2888 actualmatch
= string
.match(pattern
);
2889 expectedmatch
= Array('dxxx');
2892 status
= inSection(384);
2895 actualmatch
= string
.match(pattern
);
2896 expectedmatch
= Array('tt');
2899 /* ECMA spec says that each atom in a range must be a single character
2900 status = inSection(385);
2901 pattern = /([a-\d]+)/;
2903 actualmatch = string.match(pattern);
2904 expectedmatch = Array('9', '9');
2907 status = inSection(386);
2908 pattern = /([\d-z]+)/;
2910 actualmatch = string.match(pattern);
2911 expectedmatch = Array('0-z', '0-z');
2915 /* ECMA doesn't support [:
2916 status = inSection(387);
2917 pattern = /([a-[:digit:]]+)/;
2919 actualmatch = string.match(pattern);
2920 expectedmatch = Array('a-9', 'a-9');
2923 status = inSection(388);
2924 pattern = /([[:digit:]-z]+)/;
2926 actualmatch = string.match(pattern);
2927 expectedmatch = Array('0-z', '0-z');
2930 status = inSection(389);
2931 pattern = /([[:digit:]-[:alpha:]]+)/;
2933 actualmatch = string.match(pattern);
2934 expectedmatch = Array('0-z', '0-z');
2938 status
= inSection(390);
2939 pattern
= /(\d+\.\d+)/;
2940 string
= '3.1415926';
2941 actualmatch
= string
.match(pattern
);
2942 expectedmatch
= Array('3.1415926', '3.1415926');
2945 status
= inSection(391);
2946 pattern
= /\.c(pp|xx|c)?$/i;
2948 actualmatch
= string
.match(pattern
);
2949 expectedmatch
= Array('.c', undefined);
2952 status
= inSection(392);
2953 pattern
= /(\.c(pp|xx|c)?$)/i;
2955 actualmatch
= string
.match(pattern
);
2956 expectedmatch
= Array('.c', '.c', undefined);
2959 status
= inSection(393);
2962 actualmatch
= string
.match(pattern
);
2963 expectedmatch
= Array('ab', 'a');
2966 status
= inSection(394);
2967 pattern
= /^([ab]*?)(b)?(c)$/;
2969 actualmatch
= string
.match(pattern
);
2970 expectedmatch
= Array('abac', 'aba', undefined, 'c');
2973 status
= inSection(395);
2974 pattern
= /^(?:.,){2}c/i;
2976 actualmatch
= string
.match(pattern
);
2977 expectedmatch
= Array('a,b,c');
2980 status
= inSection(396);
2981 pattern
= /^(.,){2}c/i;
2983 actualmatch
= string
.match(pattern
);
2984 expectedmatch
= Array('a,b,c', 'b,');
2987 status
= inSection(397);
2988 pattern
= /^(?:[^,]*,){2}c/;
2990 actualmatch
= string
.match(pattern
);
2991 expectedmatch
= Array('a,b,c');
2994 status
= inSection(398);
2995 pattern
= /^([^,]*,){2}c/;
2997 actualmatch
= string
.match(pattern
);
2998 expectedmatch
= Array('a,b,c', 'b,');
3001 status
= inSection(399);
3002 pattern
= /^([^,]*,){3}d/;
3003 string
= 'aaa,b,c,d';
3004 actualmatch
= string
.match(pattern
);
3005 expectedmatch
= Array('aaa,b,c,d', 'c,');
3008 status
= inSection(400);
3009 pattern
= /^([^,]*,){3,}d/;
3010 string
= 'aaa,b,c,d';
3011 actualmatch
= string
.match(pattern
);
3012 expectedmatch
= Array('aaa,b,c,d', 'c,');
3015 status
= inSection(401);
3016 pattern
= /^([^,]*,){0,3}d/;
3017 string
= 'aaa,b,c,d';
3018 actualmatch
= string
.match(pattern
);
3019 expectedmatch
= Array('aaa,b,c,d', 'c,');
3022 status
= inSection(402);
3023 pattern
= /^([^,]{1,3},){3}d/i;
3024 string
= 'aaa,b,c,d';
3025 actualmatch
= string
.match(pattern
);
3026 expectedmatch
= Array('aaa,b,c,d', 'c,');
3029 status
= inSection(403);
3030 pattern
= /^([^,]{1,3},){3,}d/;
3031 string
= 'aaa,b,c,d';
3032 actualmatch
= string
.match(pattern
);
3033 expectedmatch
= Array('aaa,b,c,d', 'c,');
3036 status
= inSection(404);
3037 pattern
= /^([^,]{1,3},){0,3}d/;
3038 string
= 'aaa,b,c,d';
3039 actualmatch
= string
.match(pattern
);
3040 expectedmatch
= Array('aaa,b,c,d', 'c,');
3043 status
= inSection(405);
3044 pattern
= /^([^,]{1,},){3}d/;
3045 string
= 'aaa,b,c,d';
3046 actualmatch
= string
.match(pattern
);
3047 expectedmatch
= Array('aaa,b,c,d', 'c,');
3050 status
= inSection(406);
3051 pattern
= /^([^,]{1,},){3,}d/;
3052 string
= 'aaa,b,c,d';
3053 actualmatch
= string
.match(pattern
);
3054 expectedmatch
= Array('aaa,b,c,d', 'c,');
3057 status
= inSection(407);
3058 pattern
= /^([^,]{1,},){0,3}d/;
3059 string
= 'aaa,b,c,d';
3060 actualmatch
= string
.match(pattern
);
3061 expectedmatch
= Array('aaa,b,c,d', 'c,');
3064 status
= inSection(408);
3065 pattern
= /^([^,]{0,3},){3}d/i;
3066 string
= 'aaa,b,c,d';
3067 actualmatch
= string
.match(pattern
);
3068 expectedmatch
= Array('aaa,b,c,d', 'c,');
3071 status
= inSection(409);
3072 pattern
= /^([^,]{0,3},){3,}d/;
3073 string
= 'aaa,b,c,d';
3074 actualmatch
= string
.match(pattern
);
3075 expectedmatch
= Array('aaa,b,c,d', 'c,');
3078 status
= inSection(410);
3079 pattern
= /^([^,]{0,3},){0,3}d/;
3080 string
= 'aaa,b,c,d';
3081 actualmatch
= string
.match(pattern
);
3082 expectedmatch
= Array('aaa,b,c,d', 'c,');
3085 /* ECMA doesn't support \A
3086 status = inSection(411);
3087 pattern = /(?!\A)x/m;
3089 actualmatch = string.match(pattern);
3090 expectedmatch = Array('\n');
3094 status
= inSection(412);
3095 pattern
= /^(a(b)?)+$/;
3097 actualmatch
= string
.match(pattern
);
3098 expectedmatch
= Array('aba', 'a', undefined);
3101 status
= inSection(413);
3102 pattern
= /^(aa(bb)?)+$/;
3104 actualmatch
= string
.match(pattern
);
3105 expectedmatch
= Array('aabbaa', 'aa', undefined);
3108 status
= inSection(414);
3109 pattern
= /^.{9}abc.*\n/m;
3110 string
= '123\nabcabcabcabc\n';
3111 actualmatch
= string
.match(pattern
);
3112 expectedmatch
= Array('abcabcabcabc\n');
3115 status
= inSection(415);
3116 pattern
= /^(a)?a$/;
3118 actualmatch
= string
.match(pattern
);
3119 expectedmatch
= Array('a', undefined);
3122 status
= inSection(416);
3123 pattern
= /^(a\1?)(a\1?)(a\2?)(a\3?)$/;
3125 actualmatch
= string
.match(pattern
);
3126 expectedmatch
= Array('aaaaaa', 'a', 'aa', 'a', 'aa');
3129 /* Can't refer to a capture before it's encountered & completed
3130 status = inSection(417);
3131 pattern = /^(a\1?){4}$/;
3133 actualmatch = string.match(pattern);
3134 expectedmatch = Array('aaaaaa', 'aaa');
3138 status
= inSection(418);
3139 pattern
= /^(0+)?(?:x(1))?/;
3141 actualmatch
= string
.match(pattern
);
3142 expectedmatch
= Array('x1', undefined, '1');
3145 status
= inSection(419);
3146 pattern
= /^([0-9a-fA-F]+)(?:x([0-9a-fA-F]+)?)(?:x([0-9a-fA-F]+))?/;
3147 string
= '012cxx0190';
3148 actualmatch
= string
.match(pattern
);
3149 expectedmatch
= Array('012cxx0190', '012c', undefined, '0190');
3152 status
= inSection(420);
3153 pattern
= /^(b+?|a){1,2}c/;
3155 actualmatch
= string
.match(pattern
);
3156 expectedmatch
= Array('bbbac', 'a');
3159 status
= inSection(421);
3160 pattern
= /^(b+?|a){1,2}c/;
3162 actualmatch
= string
.match(pattern
);
3163 expectedmatch
= Array('bbbbac', 'a');
3166 status
= inSection(422);
3167 pattern
= /((?:aaaa|bbbb)cccc)?/;
3168 string
= 'aaaacccc';
3169 actualmatch
= string
.match(pattern
);
3170 expectedmatch
= Array('aaaacccc', 'aaaacccc');
3173 status
= inSection(423);
3174 pattern
= /((?:aaaa|bbbb)cccc)?/;
3175 string
= 'bbbbcccc';
3176 actualmatch
= string
.match(pattern
);
3177 expectedmatch
= Array('bbbbcccc', 'bbbbcccc');
3183 //-----------------------------------------------------------------------------
3185 //-----------------------------------------------------------------------------
3191 if(omitCurrentSection())
3194 statusmessages
[i
] = status
;
3195 patterns
[i
] = pattern
;
3196 strings
[i
] = string
;
3197 actualmatches
[i
] = actualmatch
;
3198 expectedmatches
[i
] = expectedmatch
;
3203 function omitCurrentSection()
3207 // current section number is in global status variable
3208 var n
= status
.match(/(\d+)/)[1];
3209 return ((n
< cnLBOUND
) || (n
> cnUBOUND
));
3221 printBugNumber (bug
);
3222 printStatus (summary
);
3223 testRegExp(statusmessages
, patterns
, strings
, actualmatches
, expectedmatches
);