aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html')
-rw-r--r--files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html b/files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html
new file mode 100644
index 0000000000..8608cfd1c2
--- /dev/null
+++ b/files/zh-cn/web/javascript/reference/global_objects/regexp/dotall/index.html
@@ -0,0 +1,47 @@
+---
+title: RegExp.prototype.dotAll
+slug: Web/JavaScript/Reference/Global_Objects/RegExp/dotAll
+tags:
+ - JavaScript
+ - 修饰符
+ - 正则表达式
+translation_of: Web/JavaScript/Reference/Global_Objects/RegExp/dotAll
+---
+<p>{{JSRef}}{{Draft}}</p>
+
+<p><strong><code>dotAll</code></strong> 属性表明是否在正则表达式中一起使用"<code>s</code>"修饰符(引入/s修饰符,使得.可以匹配任意单个字符)。<code>dotAll</code> 是一个只读的属性,属于单个正则表达式实例。</p>
+
+<p>{{JS_Property_Attributes(0, 0, 1)}}</p>
+
+<h2 id="描述">描述</h2>
+
+<p>如果使用了"<code>s</code>"修饰符,<code>dotAll</code> 的值将返回{{JSxRef("Boolean")}}类型的<code>true</code>,否则将返回<code>false</code>。"<code>s</code>"修饰符表示,特殊字符"<code>.</code>"应另外匹配字符串中的下述行终结符(line terminator characters),否则将会失配:</p>
+
+<ul>
+ <li>U+000A 换行符("<code>\n</code>")</li>
+ <li>U+000D 回车符("<code>\r</code>")</li>
+ <li>U+2028 行分隔符(<span class="message-body-wrapper"><span class="message-flex-body"><span class="devtools-monospace message-body"><span class="objectBox objectBox-string">line separator</span></span></span></span>)</li>
+ <li>U+2029 段分隔符(<span class="message-body-wrapper"><span class="message-flex-body"><span class="devtools-monospace message-body"><span class="objectBox objectBox-string">paragraph separator</span></span></span></span>)</li>
+</ul>
+
+<p>这实际上意味着"<code>.</code>"将会匹配任意的单个Unicode Basic Multilingual Plane (BMP)字符。若要使其与astral字符(大于\uFFFF的Unicode字符)匹配,你应当使用"<code>u</code>"(Unicode)修饰符。一起使用这两个修饰符,"<code>.</code>"将无一例外地匹配任意Unicode字符。</p>
+
+<p>无法直接修改此属性。</p>
+
+<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>