This is an experimental technology, part of the ECMAScript 6 (Harmony) proposal.
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future version of browsers as the spec changes.
Summary
The unicode property indicates whether or not the "u" flag is used with the 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.
Examples
Example: Using the unicode property
var regex = new RegExp('\u{61}', 'u');
console.log(regex.unicode); // true
Specifications
| Specification | Status | Comment |
|---|---|---|
| ECMAScript 6 (ECMA-262) The definition of 'RegExp.prototype.unicode' in that specification. |
Draft | Initial definition. |
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | Not supported | Not supported | Not supported | Not supported | Not supported |
| Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|---|
| Basic support | Not supported | Not supported | Not supported | Not supported | Not supported | Not supported |