Web/JavaScript/Reference/Global objects/RegExp/unicode

From Get docs


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


Description

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.

Examples

Using the unicode property

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

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

Specifications

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile Server
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet Node.js
unicode Chrome

Full support 50

Edge Full support 12

Notes'

Full support 12

Notes'

Notes' Case folding is implemented in version 13

Firefox

Full support 46

IE

No support No

Opera

Full support 37

Safari

Full support 10

WebView Android

Full support 50

Chrome Android

Full support 50

Firefox Android

Full support 46

Opera Android

Full support 37

Safari iOS

Full support 10

Samsung Internet Android

Full support 5.0

nodejs Full support 6.0.0

Notes'

Full support 6.0.0

Notes'

Notes' Case folding is implemented in version 8.6.0

Legend

Full support  
Full support
No support  
No support
See implementation notes.'
See implementation notes.


See also