| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'RegExp_lastParen_as_array.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"'; |
| 17 |
var VERSION = 'no version'; |
| 18 |
startTest(); |
| 19 |
var TITLE = 'RegExp: $+'; |
| 20 |
|
| 21 |
writeHeaderToLog('Executing script: RegExp_lastParen_as_array.js'); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
'abcd'.match(/(abc)d/); |
| 26 |
new TestCase ( SECTION, "'abcd'.match(/(abc)d/); RegExp['$+']", |
| 27 |
'abc', RegExp['$+']); |
| 28 |
|
| 29 |
|
| 30 |
'abcd'.match(/(bcd)e/); |
| 31 |
new TestCase ( SECTION, "'abcd'.match(/(bcd)e/); RegExp['$+']", |
| 32 |
'abc', RegExp['$+']); |
| 33 |
|
| 34 |
|
| 35 |
'abcdefg'.match(/(a(b(c(d)e)f)g)/); |
| 36 |
new TestCase ( SECTION, "'abcdefg'.match(/(a(b(c(d)e)f)g)/); RegExp['$+']", |
| 37 |
'd', RegExp['$+']); |
| 38 |
|
| 39 |
|
| 40 |
'abcdefg'.match(new RegExp('(a(b(c(d)e)f)g)')); |
| 41 |
new TestCase ( SECTION, "'abcdefg'.match(new RegExp('(a(b(c(d)e)f)g)')); RegExp['$+']", |
| 42 |
'd', RegExp['$+']); |
| 43 |
|
| 44 |
|
| 45 |
'abcdefg'.match(/(a(b)c)(d(e)f)/); |
| 46 |
new TestCase ( SECTION, "'abcdefg'.match(/(a(b)c)(d(e)f)/); RegExp['$+']", |
| 47 |
'e', RegExp['$+']); |
| 48 |
|
| 49 |
|
| 50 |
'abcdefg'.match(/(^)abc/); |
| 51 |
new TestCase ( SECTION, "'abcdefg'.match(/(^)abc/); RegExp['$+']", |
| 52 |
'', RegExp['$+']); |
| 53 |
|
| 54 |
|
| 55 |
'abcdefg'.match(/(^a)bc/); |
| 56 |
new TestCase ( SECTION, "'abcdefg'.match(/(^a)bc/); RegExp['$+']", |
| 57 |
'a', RegExp['$+']); |
| 58 |
|
| 59 |
|
| 60 |
'abcdefg'.match(new RegExp('(^a)bc')); |
| 61 |
new TestCase ( SECTION, "'abcdefg'.match(new RegExp('(^a)bc')); RegExp['$+']", |
| 62 |
'a', RegExp['$+']); |
| 63 |
|
| 64 |
|
| 65 |
'abcdefg'.match(/bc/); |
| 66 |
new TestCase ( SECTION, "'abcdefg'.match(/bc/); RegExp['$+']", |
| 67 |
'', RegExp['$+']); |
| 68 |
|
| 69 |
test(); |