W3cubDocs

/JavaScript

regExp.unicode

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
unicode 50 12
12
Case folding is implemented in version 13
46 No 37 10
Mobile
Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
unicode 50 50 46 37 10 5.0
Server
Node.js
unicode 6.0.0
6.0.0
Case folding is implemented in version 8.6.0

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://wiki.developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/unicode