diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/javascript/reference/global_objects/regexp/dotall | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/javascript/reference/global_objects/regexp/dotall')
-rw-r--r-- | files/ja/web/javascript/reference/global_objects/regexp/dotall/index.html | 87 |
1 files changed, 87 insertions, 0 deletions
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 +--- +<p>{{JSRef}}</p> + +<p><strong><code>dotAll</code></strong> プロパティは、正規表現で "<code>s</code>" フラグが使用されているかどうかを示します。 <code>dotAll</code> は、個々の正規表現インスタンスの読み取り専用プロパティです。</p> + +<div>{{EmbedInteractiveExample("pages/js/regexp-prototype-dotall.html")}}</div> + +<p>{{JS_Property_Attributes(0, 0, 1)}}</p> + +<h2 id="説明">説明</h2> + +<p>dotAllの値は {{JSxRef("Boolean")}} であり、"<code>s</code>" フラグが使用されている場合は <code>true</code> 、それ以外の場合は <code>false</code> です。 "<code>s</code>" フラグは、ドット特殊文字 ("<code>.</code>") が以下に示す行末記号 ("<code>newline</code>") 文字と一致することを示します。これ以外の場合は一致しません:</p> + +<ul> + <li>U+000A 改行 (LF) ("<code>\n</code>")</li> + <li>U+000D キャリッジリターン (CR) ("<code>\r</code>")</li> + <li>U+2028 ラインセパレーター</li> + <li>U+2029 段落区切り文字</li> +</ul> + +<p>これは事実上、ドットが基本多言語面 (BMP) のすべての文字と一致することを意味します。 アストラル文字と一致させるには、"<code>u</code>" (ユニコード) フラグを使用する必要があります。 両方のフラグを組み合わせて使用すると、ドットは例外なく任意のユニコード文字に一致します。</p> + +<p>このプロパティを直接変更することはできません。</p> + +<h2 id="例">例</h2> + +<h3 id="dotAllを使用する">dotAllを使用する</h3> + +<pre class="brush: js notranslate">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</pre> + +<h2 id="仕様書">仕様書</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">仕様書</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-get-regexp.prototype.dotAll', 'RegExp.prototype.dotAll')}}</td> + </tr> + </tbody> +</table> + +<h2 id="ブラウザーの互換性">ブラウザーの互換性</h2> + +<div class="hidden">The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div> + +<p>{{Compat("javascript.builtins.RegExp.dotAll")}}</p> + +<h2 id="関連情報">関連情報</h2> + +<ul> + <li>{{JSxRef("RegExp.lastIndex")}}</li> + <li>{{JSxRef("RegExp.prototype.global")}}</li> + <li>{{JSxRef("RegExp.prototype.ignoreCase")}}</li> + <li>{{JSxRef("RegExp.prototype.multiline")}}</li> + <li>{{JSxRef("RegExp.prototype.source")}}</li> + <li>{{JSxRef("RegExp.prototype.sticky")}}</li> + <li>{{JSxRef("RegExp.prototype.unicode")}}</li> +</ul> |