首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

regExp.unicode

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

| RegExp.prototype.unicode属性的属性特性 |

|:----|

| Writable | no |

| Enumerable | no |

| Configurable | yes |

描述

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

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

示例

使用 unicode 属性

代码语言:javascript
复制
var regex = new RegExp('\u{61}', 'u');

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

规范

Specification

Status

Comment

ECMAScript 2015 (6th Edition, ECMA-262)The definition of 'RegExp.prototype.unicode' in that specification.

Standard

Initial definition.

ECMAScript Latest Draft (ECMA-262)The definition of 'RegExp.prototype.unicode' in that specification.

Draft

?

浏览器兼容性

Feature

Chrome

Edge

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

50

12 (case folding 13)

46 (46)

No support

37

10

Feature

Android

Chrome for Android

Edge

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

No support

50

(Yes)

46.0 (46)

No support

(Yes)

10

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com