Test to ensure correct behaviour when using backreferences in a RegExp On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS /(...)\1$/.test('abcabc') is true PASS /(...)\1$/.test('abcdef') is false PASS /(...)\2$/.test('abcabc') is false PASS /(...)\2$/.test('abc') is false PASS /\1(...)$/.test('abcabc') is true PASS /\1(...)$/.test('abcdef') is true PASS /\2(...)$/.test('abcabc') is false PASS /\2(...)$/.test('abc') is false PASS /\1?(...)$/.test('abc') is true PASS /\1?(...)$/.test('abc') is true PASS successfullyParsed is true TEST COMPLETE