The unicode
property indicates whether or not the "u
" flag is used with a regular expression. unicode
is a read-only property of an individual regular expression instance.
Property attributes of RegExp.prototype.unicode
| |
---|---|
Writable | no |
Enumerable | no |
Configurable | yes |
The value of unicode
is a Boolean
and true
if the "u
" flag was used; otherwise false
. The "u
" flag enables various Unicode-related features. With the "u" flag, any Unicode code point escapes will be interpreted as such, for example.
You cannot change this property directly. It is read-only.
unicode
propertyvar 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 |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 50 | 12
|
46 | No | 37 | 10 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 50 | Yes | 46 | 37 | 10 | 5.0 |
Server | |
---|---|
Node.js | |
Basic support | Yes |
RegExp.lastIndex
RegExp.prototype.global
RegExp.prototype.ignoreCase
RegExp.prototype.multiline
RegExp.prototype.source
RegExp.prototype.sticky
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode