RegExp.prototype.unicode

unicode プロパティは、 "u" フラグが正規表現で使われているかどうかを示します。unicode は正規表現インスタンスごとの読み取り専用プロパティです。

試してみましょう

RegExp.prototype.unicode のプロパティ属性
書込可能 不可
列挙可能 不可
設定可能

解説

unicode の値は Boolean です。"u" が使われていたら、true です。さもなければ、false です。"u" フラグは様々な Unicode 関連の機能を有効にします。"u" フラグで、どんな Unicode コードポイントエスケープでもそのようなものとして解釈されます。

このプロパティを直接変更することはできません。読み取り専用です。

unicode プロパティの使用

js

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

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

仕様書

Specification
ECMAScript Language Specification
# sec-get-regexp.prototype.unicode

ブラウザーの互換性

BCD tables only load in the browser

関連情報