--- title: RegExp.prototype.unicode slug: Web/JavaScript/Reference/Global_Objects/RegExp/unicode tags: - ECMAScript 2015 - JavaScript - Property - Prototype - Reference - RegExp - Regular Expressions translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/unicode ---
unicode プロパティは、 "u" フラグが正規表現で使われているかどうかを示します。unicode は正規表現インスタンスごとの読み取り専用プロパティです。
unicode の値は {{jsxref("Boolean")}} です。"u" が使われていたら、true です。さもなければ、false です。"u" フラグは様々な Unicode 関連の機能を有効にします。"u" フラグで、どんな Unicode コードポイントエスケープでもそのようなものとして解釈されます。
このプロパティを直接変更することはできません。読み取り専用です。
var regex = new RegExp('\u{61}', 'u');
console.log(regex.unicode); // true
| 仕様書 |
|---|
| {{SpecName('ESDraft', '#sec-get-regexp.prototype.unicode', 'RegExp.prototype.unicode')}} |
{{Compat("javascript.builtins.RegExp.unicode")}}