From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../global_objects/regexp/dotall/index.html | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 files/ja/web/javascript/reference/global_objects/regexp/dotall/index.html (limited to 'files/ja/web/javascript/reference/global_objects/regexp/dotall') diff --git a/files/ja/web/javascript/reference/global_objects/regexp/dotall/index.html b/files/ja/web/javascript/reference/global_objects/regexp/dotall/index.html new file mode 100644 index 0000000000..b7e18ebf2d --- /dev/null +++ b/files/ja/web/javascript/reference/global_objects/regexp/dotall/index.html @@ -0,0 +1,87 @@ +--- +title: RegExp.prototype.dotAll +slug: Web/JavaScript/Reference/Global_Objects/RegExp/dotAll +tags: + - Draft + - JavaScript + - Property + - Prototype + - Reference + - RegExp + - Regular Expressions +translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/dotAll +--- +

{{JSRef}}

+ +

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

+ +
{{EmbedInteractiveExample("pages/js/regexp-prototype-dotall.html")}}
+ +

{{JS_Property_Attributes(0, 0, 1)}}

+ +

説明

+ +

dotAllの値は {{JSxRef("Boolean")}} であり、"s" フラグが使用されている場合は true 、それ以外の場合は false です。 "s" フラグは、ドット特殊文字 (".") が以下に示す行末記号 ("newline") 文字と一致することを示します。これ以外の場合は一致しません:

+ + + +

これは事実上、ドットが基本多言語面 (BMP) のすべての文字と一致することを意味します。 アストラル文字と一致させるには、"u" (ユニコード) フラグを使用する必要があります。 両方のフラグを組み合わせて使用すると、ドットは例外なく任意のユニコード文字に一致します。

+ +

このプロパティを直接変更することはできません。

+ +

+ +

dotAllを使用する

+ +
var str1 = 'bar\nexample foo example';
+
+var regex1 = new RegExp('bar.example','s');
+
+console.log(regex1.dotAll); // Output: true
+
+console.log(str1.replace(regex1,'')); // Output: foo example
+
+var str2 = 'bar\nexample foo example';
+
+var regex2 = new RegExp('bar.example');
+
+console.log(regex2.dotAll); // Output: false
+
+console.log(str2.replace(regex2,'')); // Output: bar
+                                      //         example foo example
+ +

仕様書

+ + + + + + + + + + +
仕様書
{{SpecName('ESDraft', '#sec-get-regexp.prototype.dotAll', 'RegExp.prototype.dotAll')}}
+ +

ブラウザーの互換性

+ + + +

{{Compat("javascript.builtins.RegExp.dotAll")}}

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf