2019-04-21 11:50:48 +08:00

51 lines
4.5 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<article id="wikiArticle">
<p></p><div class="blockIndicator draft">
<p><strong>草案</strong><br/>
本页尚未完工.</p>
</div><p></p>
<p><strong><code>dotAll</code></strong> 属性表明是否在正则表达式中一起使用"<code>s</code>"修饰符(引入/s修饰符使得.可以匹配任意单个字符)。<code>dotAll</code> 是一个只读的属性,属于单个正则表达式实例。</p>
<p></p><table class="standard-table">
<thead>
<tr>
<th class="header" colspan="2"><code>RegExp.prototype.dotAll</code> 属性的属性特性:</th>
</tr>
</thead>
<tbody>
<tr>
<td>writable</td>
<td>false</td>
</tr>
<tr>
<td>enumerable</td>
<td>false</td>
</tr>
<tr>
<td>configurable</td>
<td>true</td>
</tr>
</tbody>
</table><p></p>
<h2 id="描述">描述</h2>
<p>如果使用了"<code>s</code>"修饰符,<code>dotAll</code> 的值将返回<a href="Reference/Boolean" title="此页面仍未被本地化, 期待您的翻译!"><code>Boolean</code></a>类型的<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 class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</div>
<p>No compatibility data found. Please contribute data for "javascript.builtins.RegExp.dotAll" (depth: 1) to the <a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">MDN compatibility data repository</a>.</p>
<h2 id="相关链接">相关链接</h2>
<ul>
<li><a href="Reference/Global_Objects/RegExp/lastIndex" title="lastIndex 是正则表达式的一个可读可写的整型属性用来指定下一次匹配的起始索引。"><code>RegExp.lastIndex</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/global" title='global 属性表明正则表达式是否使用了 "g" 标志。global 是一个正则表达式实例的只读属性。'><code>RegExp.prototype.global</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/ignoreCase" title='ignoreCase 属性表明正则表达式是否使用了 "i" 标志。ignoreCase 是正则表达式实例的只读属性。'><code>RegExp.prototype.ignoreCase</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/multiline" title='multiline 属性表明正则表达式是否使用了 "m" 标志。multiline 是正则表达式实例的一个只读属性。'><code>RegExp.prototype.multiline</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/source" title="source 属性返回一个值为当前正则表达式对象的模式文本的字符串,该字符串不会包含正则字面量两边的斜杠以及任何的标志字符。"><code>RegExp.prototype.source</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/sticky" title="sticky 属性反映了搜索是否具有粘性 仅从正则表达式的 lastIndex 属性表示的索引处搜索 。sticky 是正则表达式对象的只读属性。"><code>RegExp.prototype.sticky</code></a></li>
<li><a href="Reference/Global_Objects/RegExp/unicode" title='unicode 属性表明正则表达式带有"u" 标志。 unicode 是正则表达式独立实例的只读属性。'><code>RegExp.prototype.unicode</code></a></li>
</ul>
</article>