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 compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 50 121 46 No 37 10
Feature Android webview Chrome for Android Edge mobile Firefox for Android Opera Android iOS Safari Samsung Internet
Basic support Yes 50 Yes 46 37 10 ?

1. Case folding is implemented in version 13

See also

© 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