根据this,代码点U + 10000到U + 10FFFF用4个字节编码。
使用最新的Node版本(v6,也许是v5,但我没有测试),你可以在这样的正则表达式中使用它们(注意u
标志):
const str = 'hello world!';
console.log( /[\u{10000}-\u{10FFFF}]/u.test(str) ); // true
console.log( str.replace(/[\u{10000}-\u{10FFFF}]/gu, '') ); // `hello world!`
(更多信息here)