RegExp.prototype.unicode - JavaScript 编辑

unicode 属性表明正则表达式带有"u" 标志。 unicode 是正则表达式独立实例的只读属性。

RegExp.prototype.unicode 属性的属性特性:
writable false
enumerable false
configurable true

描述

unicode 的值是 Boolean,并且如果使用了 "u" 标志则为 true;否则为 false。"u" 标志开启了多种 Unicode 相关的特性。使用 "u" 标志,任何 Unicode 代码点的转义都会被解释。

你不能直接修改这个属性,它是只读的。

示例

使用 unicode 属性

var regex = new RegExp('\u{61}', 'u');

console.log(regex.unicode); // true

规范

Specification Status Comment
ECMAScript 2015 (6th Edition, ECMA-262)
RegExp.prototype.unicode
Standard 初始定义。
ECMAScript Latest Draft (ECMA-262)
RegExp.prototype.unicode
Draft  

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!
Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari
Basic support 50 12 (case folding 13) 46 (46) 未实现 37 10
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 未实现 50 46.0 (46) 未实现 (Yes) 10

另见

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:64 次

字数:4761

最后编辑:7 年前

编辑次数:0 次

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文