1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8
Filename: RegExp_lastParen_as_array.js
9
Description: 'Tests RegExps $+ property (same tests as RegExp_lastParen.js but using $+)'
15
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
16
var VERSION = 'no version';
18
var TITLE = 'RegExp: $+';
20
writeHeaderToLog('Executing script: RegExp_lastParen_as_array.js');
21
writeHeaderToLog( SECTION + " "+ TITLE);
23
// 'abcd'.match(/(abc)d/); RegExp['$+']
24
'abcd'.match(/(abc)d/);
25
new TestCase ( SECTION, "'abcd'.match(/(abc)d/); RegExp['$+']",
28
// 'abcd'.match(/(bcd)e/); RegExp['$+']
29
'abcd'.match(/(bcd)e/);
30
new TestCase ( SECTION, "'abcd'.match(/(bcd)e/); RegExp['$+']",
33
// 'abcdefg'.match(/(a(b(c(d)e)f)g)/); RegExp['$+']
34
'abcdefg'.match(/(a(b(c(d)e)f)g)/);
35
new TestCase ( SECTION, "'abcdefg'.match(/(a(b(c(d)e)f)g)/); RegExp['$+']",
38
// 'abcdefg'.match(new RegExp('(a(b(c(d)e)f)g)')); RegExp['$+']
39
'abcdefg'.match(new RegExp('(a(b(c(d)e)f)g)'));
40
new TestCase ( SECTION, "'abcdefg'.match(new RegExp('(a(b(c(d)e)f)g)')); RegExp['$+']",
43
// 'abcdefg'.match(/(a(b)c)(d(e)f)/); RegExp['$+']
44
'abcdefg'.match(/(a(b)c)(d(e)f)/);
45
new TestCase ( SECTION, "'abcdefg'.match(/(a(b)c)(d(e)f)/); RegExp['$+']",
48
// 'abcdefg'.match(/(^)abc/); RegExp['$+']
49
'abcdefg'.match(/(^)abc/);
50
new TestCase ( SECTION, "'abcdefg'.match(/(^)abc/); RegExp['$+']",
53
// 'abcdefg'.match(/(^a)bc/); RegExp['$+']
54
'abcdefg'.match(/(^a)bc/);
55
new TestCase ( SECTION, "'abcdefg'.match(/(^a)bc/); RegExp['$+']",
58
// 'abcdefg'.match(new RegExp('(^a)bc')); RegExp['$+']
59
'abcdefg'.match(new RegExp('(^a)bc'));
60
new TestCase ( SECTION, "'abcdefg'.match(new RegExp('(^a)bc')); RegExp['$+']",
63
// 'abcdefg'.match(/bc/); RegExp['$+']
64
'abcdefg'.match(/bc/);
65
new TestCase ( SECTION, "'abcdefg'.match(/bc/); RegExp['$+']",