Lines Matching refs:RegExp
33 var TITLE = 'RegExp: |';
41 // 'abc'.match(new RegExp('xyz|abc'))
42 testcases[count++] = new TestCase ( SECTION, "'abc'.match(new RegExp('xyz|abc'))",
43 String(["abc"]), String('abc'.match(new RegExp('xyz|abc'))));
45 // 'this is a test'.match(new RegExp('quiz|exam|test|homework'))
46 testcases[count++] = new TestCase ( SECTION, "'this is a test'.match(new RegExp('quiz|exam|test|homework'))",
47 String(["test"]), String('this is a test'.match(new RegExp('quiz|exam|test|homework'))));
49 // 'abc'.match(new RegExp('xyz|...'))
50 testcases[count++] = new TestCase ( SECTION, "'abc'.match(new RegExp('xyz|...'))",
51 String(["abc"]), String('abc'.match(new RegExp('xyz|...'))));
53 // 'abc'.match(new RegExp('(.)..|abc'))
54 testcases[count++] = new TestCase ( SECTION, "'abc'.match(new RegExp('(.)..|abc'))",
55 String(["abc","a"]), String('abc'.match(new RegExp('(.)..|abc'))));
57 // 'color: grey'.match(new RegExp('.+: gr(a|e)y'))
58 testcases[count++] = new TestCase ( SECTION, "'color: grey'.match(new RegExp('.+: gr(a|e)y'))",
59 String(["color: grey","e"]), String('color: grey'.match(new RegExp('.+: gr(a|e)y'))));
61 // 'no match'.match(new RegExp('red|white|blue'))
62 testcases[count++] = new TestCase ( SECTION, "'no match'.match(new RegExp('red|white|blue'))",
63 null, 'no match'.match(new RegExp('red|white|blue')));
65 // 'Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)'))
66 testcases[count++] = new TestCase ( SECTION, "'Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)'))",
67 String(["Bob",undefined,"Bob", undefined, undefined]), String('Hi Bob'.match(new RegExp('(Rob)|(Bob)|(Robert)|(Bobby)'))));
69 // 'abcdef'.match(new RegExp('abc|bcd|cde|def'))
70 testcases[count++] = new TestCase ( SECTION, "'abcdef'.match(new RegExp('abc|bcd|cde|def'))",
71 String(["abc"]), String('abcdef'.match(new RegExp('abc|bcd|cde|def'))));