| Test for unicode regular expression processing |
| |
| On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". |
| |
| |
| PASS "a".match(/a/u)[0].length is 1 |
| PASS "a".match(/A/ui)[0].length is 1 |
| PASS "a".match(/a/u)[0].length is 1 |
| PASS "a".match(/A/iu)[0].length is 1 |
| PASS "Ȓ".match(/Ȓ/u)[0].length is 1 |
| PASS "Ȓ".match(/Ȓ/u)[0].length is 1 |
| PASS "ሴ".match(/ሴ/u)[0].length is 1 |
| PASS "ሴ".match(/ሴ/u)[0].length is 1 |
| PASS "⪼".match(/⪼/u)[0].length is 1 |
| PASS "㿭".match(/㿭/u)[0].length is 1 |
| PASS "𒍅".match(/𒍅/u)[0].length is 2 |
| PASS "𒍅".match(/𒍅/u)[0].length is 2 |
| PASS "𝌆".match(/𝌆/u)[0].length is 2 |
| PASS /𐑏/u.test("𐑏") is true |
| PASS /𐑏/u.test("𐑏") is true |
| PASS "𝌆".match(/𝌆/u)[0].length is 2 |
| PASS /(𐀀|𐐀|𐐩)/u.test("𐐀") is true |
| PASS "𐄣".match(/a|𐄣|b/u)[0].length is 2 |
| PASS "b".match(/a|𐄣|b/u)[0].length is 1 |
| PASS /(?:a|𐄣|b)x/u.test("𐄣") is false |
| PASS /(?:a|𐄣|b)x/u.test("𐄣x") is true |
| PASS /(?:a|𐄣|b)x/u.test("b") is false |
| PASS /(?:a|𐄣|b)x/u.test("bx") is true |
| PASS "a𐄣x".match(/a𐄣b|a𐄣x/u)[0].length is 4 |
| PASS /(𐀀|𐐀|𐐩)x/ui.test("𐐀x") is true |
| PASS /(𐀀|𐐀|𐐩)x/ui.test("𐐩x") is true |
| PASS /(𐀀|𐐀|𐐩)x/ui.test("𐐁x") is true |
| PASS /(𐀀|𐐀|𐐩)x/ui.test("𐐨x") is true |
| PASS "𐐩".match(/a|𐐁|b/iu)[0].length is 2 |
| PASS "B".match(/a|𐄣|b/iu)[0].length is 1 |
| PASS /(?:A|𐄣|b)x/iu.test("𐄣") is false |
| PASS /(?:A|𐄣|b)x/iu.test("𐄣x") is true |
| PASS /(?:A|𐄣|b)x/iu.test("b") is false |
| PASS /(?:A|𐄣|b)x/iu.test("bx") is true |
| PASS "a𐄣X".match(/a𐄣b|a𐄣x/iu)[0].length is 4 |
| PASS "Ťx".match(/ťx/iu)[0].length is 2 |
| PASS /\w/iu.test("ſ") is true |
| PASS /\w/iu.test("K") is true |
| PASS /\W/iu.test("ſ") is false |
| PASS /\W/iu.test("K") is false |
| PASS /[\w\d]/iu.test("ſ") is true |
| PASS /[\w\d]/iu.test("K") is true |
| PASS /[^\w\d]/iu.test("ſ") is false |
| PASS /[^\w\d]/iu.test("K") is false |
| PASS /[\W\d]/iu.test("ſ") is false |
| PASS /[\W\d]/iu.test("K") is false |
| PASS /[^\W\d]/iu.test("ſ") is true |
| PASS /[^\W\d]/iu.test("K") is true |
| PASS /\w/iu.test("S") is true |
| PASS /\w/iu.test("K") is true |
| PASS /\W/iu.test("S") is false |
| PASS /\W/iu.test("K") is false |
| PASS /[\w\d]/iu.test("S") is true |
| PASS /[\w\d]/iu.test("K") is true |
| PASS /[^\w\d]/iu.test("S") is false |
| PASS /[^\w\d]/iu.test("K") is false |
| PASS /[\W\d]/iu.test("S") is false |
| PASS /[\W\d]/iu.test("K") is false |
| PASS /[^\W\d]/iu.test("S") is true |
| PASS /[^\W\d]/iu.test("K") is true |
| PASS "Grasſoden is old German for grass".match(/.*?\Bs\u017foden/iu)[0] is "Grasſoden" |
| PASS "Grasſoden is old German for grass".match(/.*?\B\u017foden/iu)[0] is "Grasſoden" |
| PASS "Grasſoden is old German for grass".match(/.*?\Boden/iu)[0] is "Grasſoden" |
| PASS "Grasſoden is old German for grass".match(/.*?\Bden/iu)[0] is "Grasſoden" |
| PASS "Water freezes at 273K which is 0C.".split(/\b\s/iu) is ["Water","freezes","at","273K","which","is","0C."] |
| PASS "𝌆".match(/^.$/u)[0].length is 2 |
| PASS "It is 78°".match(/.*/u)[0].length is 9 |
| PASS stringWithDanglingFirstSurrogate.match(/.*/u)[0].length is 3 |
| PASS stringWithDanglingSecondSurrogate.match(/.*/u)[0].length is 3 |
| PASS "𝌆".match(/[𝌆a]/)[0].length is 1 |
| PASS "𝌆".match(/[a𝌆]/u)[0].length is 2 |
| PASS "𝌆".match(/[𝌆a]/u)[0].length is 2 |
| PASS "𝌆".match(/[a-𝌆]/)[0].length is 1 |
| PASS "𝌆".match(/[a-𝌆]/u)[0].length is 2 |
| PASS "X".match(/[ -𐑏]/u)[0].length is 1 |
| PASS "က".match(/[ -𐑏]/u)[0].length is 1 |
| PASS "𐐧".match(/[ -𐑏]/u)[0].length is 2 |
| PASS re1.test("Z") is false |
| PASS re1.test("က") is false |
| PASS re1.test("𐐀") is false |
| PASS re2.test("A") is true |
| PASS re2.test("") is false |
| PASS re2.test("𒍅") is true |
| PASS /𝌆{2}/u.test("𝌆𝌆") is true |
| PASS /𝌆{2}/u.test("𝌆𝌆") is true |
| PASS "𐐁𐐁𐐀".match(/𐐁{1,3}/u)[0] is "𐐁𐐁" |
| PASS "𐐁𐐩".match(/𐐁{1,3}/iu)[0] is "𐐁𐐩" |
| PASS "𐐁𐐩𐐪𐐩".match(/𐐁{1,}/iu)[0] is "𐐁𐐩" |
| PASS "𐌑𐌑𐌑".match(/𐌑*a|𐌑*./u)[0] is "𐌑𐌑𐌑" |
| PASS "a𐌑𐌑".match(/a𐌑*?$/u)[0] is "a𐌑𐌑" |
| PASS "a𐌑𐌑𐌑c".match(/a𐌑*cd|a𐌑*c/u)[0] is "a𐌑𐌑𐌑c" |
| PASS "a𐌑𐌑𐌑c".match(/a𐌑+cd|a𐌑+c/u)[0] is "a𐌑𐌑𐌑c" |
| PASS "𐌑𐌑𐌑".match(/𐌑+?a|𐌑+?./u)[0] is "𐌑𐌑" |
| PASS "𐌑𐌑𐌑".match(/𐌑+?a|𐌑+?$/u)[0] is "𐌑𐌑𐌑" |
| PASS "a𐌑𐌑𐌑c".match(/a𐌑*?cd|a𐌑*?c/u)[0] is "a𐌑𐌑𐌑c" |
| PASS "a𐌑𐌑𐌑c".match(/a𐌑+?cd|a𐌑+?c/u)[0] is "a𐌑𐌑𐌑c" |
| PASS "𐌑𐌑𐌑".match(/𐌑+?a|𐌑+?./iu)[0] is "𐌑𐌑" |
| PASS "𐐪𐐪𐌑".match(/𐐂*|𐐂*𐌑/iu)[0] is "𐐪𐐪𐌑" |
| PASS "𐐪𐐪𐌑".match(/𐐂+|𐐂+𐌑/iu)[0] is "𐐪𐐪𐌑" |
| PASS "𐐪𐐪𐌑".match(/𐐂*?|𐐂*?𐌑/iu)[0] is "𐐪𐐪𐌑" |
| PASS "𐐪𐐪𐌑".match(/𐐂+?|𐐂+?𐌑/iu)[0] is "𐐪𐐪𐌑" |
| PASS "ab𐌑c𐨁".match(/abc|ab𐌑cd|ab𐌑c𐨁d|ab𐌑c𐨁/u)[0] is "ab𐌑c𐨁" |
| PASS "ab𐐨c𐨁".match(/abc|ab𐐀cd|ab𐐀c𐨁d|ab𐐀c𐨁/iu)[0] is "ab𐐨c𐨁" |
| PASS /abc|ab𐐀cd|ab𐐀c𐨁d|ab𐐀c𐨁/iu.test("qwerty123") is false |
| PASS "a𐐨𐐨𐐨c".match(/ac|a𐐀*cd|a𐐀+cd|a𐐀+c/iu)[0] is "a𐐨𐐨𐐨c" |
| PASS "ab𐐨𐐨𐐨c𐨁".match(/abc|ab𐐀*cd|ab𐐀+c𐨁d|ab𐐀+c𐨁/iu)[0] is "ab𐐨𐐨𐐨c𐨁" |
| PASS "ab𐐨𐐨𐐨".match(/abc|ab𐐨*./u)[0] is "ab𐐨𐐨𐐨" |
| PASS "ab𐐨𐐨𐐨".match(/abc|ab𐐀*./iu)[0] is "ab𐐨𐐨𐐨" |
| PASS "𐐀".match(/a*/u)[0].length is 0 |
| PASS "𐐀".match(/a*/ui)[0].length is 0 |
| PASS "𐐀".match(/\d*/u)[0].length is 0 |
| PASS "123𐐀".match(/\d*/u)[0] is "123" |
| PASS "12X3𐐀4".match(/\d{0,1}/ug) is ["1", "2", "", "3", "", "4", ""] |
| PASS match3[0] is "a𐐐𐐐b" |
| PASS match3[1] is undefined. |
| PASS match3[2] is "a𐐐𐐐b" |
| PASS match4[0] is "a𐐸𐐸b" |
| PASS match4[1] is undefined. |
| PASS match4[2] is "𐐸𐐸" |
| PASS match5[0] is "a𐐒𐐒b𐐒𐐒" |
| PASS match5[1] is undefined. |
| PASS match5[2] is "𐐒𐐒" |
| PASS match6[0] is "a𐐒𐐒b𐐺𐐒" |
| PASS match6[1] is undefined. |
| PASS match6[2] is "𐐒𐐒" |
| PASS /ſtop/ui.test("stop") is true |
| PASS /stop/ui.test("ſtop") is true |
| PASS /Kelvin/ui.test("kelvin") is true |
| PASS /KELVIN/ui.test("Kelvin") is true |
| PASS /\u{1}/.test("u") is true |
| PASS /\u{4}/.test("u") is false |
| PASS /\u{4}/.test("uuuu") is true |
| PASS "800-555-1212".match(/[0-9\-]*/u)[0].length is 12 |
| PASS "this is ba test".match(/is b\cha test/u)[0].length is 11 |
| PASS new RegExp("\\/", "u").source is "\\/" |
| PASS r = new RegExp("\\u{110000}", "u") threw exception SyntaxError: Invalid regular expression: invalid unicode {} escape. |
| PASS r = new RegExp("\\-", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("\\a", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("[\\a]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("[\\b]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("[\\B]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("\\x", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("[\\x]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("\\u", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("[\\u]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. |
| PASS r = new RegExp("\\u{", "u") threw exception SyntaxError: Invalid regular expression: invalid unicode {} escape. |
| PASS r = new RegExp("\\u{\udead", "u") threw exception SyntaxError: Invalid regular expression: invalid unicode {} escape. |
| PASS successfullyParsed is true |
| |
| TEST COMPLETE |
| |