regExp.unicode
unicode属性表明正则表达式带有"u" 标志。unicode是正则表达式独立实例的只读属性。
| RegExp.prototype.unicode属性的属性特性 |
|:----|
| Writable | no |
| Enumerable | no |
| Configurable | yes |
描述
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)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 |
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

