blob: cbd5de7c73db78ac31234c935919e588c91af409 [file] [log] [blame]
Test for beginning of line (BOL or ^) matching
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS s.match(/^notHere/) is null
PASS s.match(/^abc/) is ["abc"]
PASS s.match(/(^|X)abc/) is ["abc",""]
PASS s.match(/^longer|123/) is ["123"]
PASS s.match(/(^abc|c)123/) is ["abc123","abc"]
PASS s.match(/(c|^abc)123/) is ["abc123","abc"]
PASS s.match(/(^ab|abc)123/) is ["abc123","abc"]
PASS s.match(/(bc|^abc)([0-9]*)a/) is ["bc789a","bc","789"]
PASS /(?:(Y)X)|(X)/.exec("abc") is null
PASS /(?:(?:^|Y)X)|(X)/.exec("abc") is null
PASS /(?:(?:^|Y)X)|(X)/.exec("abcd") is null
PASS /(?:(?:^|Y)X)|(X)/.exec("Xabcd") is ["X",undefined]
PASS /(?:(?:^|Y)X)|(X)/.exec("aXbcd") is ["X","X"]
PASS /(?:(?:^|Y)X)|(X)/.exec("abXcd") is ["X","X"]
PASS /(?:(?:^|Y)X)|(X)/.exec("abcXd") is ["X","X"]
PASS /(?:(?:^|Y)X)|(X)/.exec("abcdX") is ["X","X"]
PASS /(?:(?:^|Y)X)|(X)/.exec("YXabcd") is ["YX",undefined]
PASS /(?:(?:^|Y)X)|(X)/.exec("aYXbcd") is ["YX",undefined]
PASS /(?:(?:^|Y)X)|(X)/.exec("abYXcd") is ["YX",undefined]
PASS /(?:(?:^|Y)X)|(X)/.exec("abcYXd") is ["YX",undefined]
PASS /(?:(?:^|Y)X)|(X)/.exec("abcdYX") is ["YX",undefined]
PASS successfullyParsed is true
TEST COMPLETE