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/zh-cn/web/javascript/reference/global_objects/symbol/matchall | |
| parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
| download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip | |
initial commit
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/symbol/matchall')
| -rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/symbol/matchall/index.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/symbol/matchall/index.html b/files/zh-cn/web/javascript/reference/global_objects/symbol/matchall/index.html new file mode 100644 index 0000000000..730107b31c --- /dev/null +++ b/files/zh-cn/web/javascript/reference/global_objects/symbol/matchall/index.html @@ -0,0 +1,65 @@ +--- +title: Symbol.matchAll +slug: Web/JavaScript/Reference/Global_Objects/Symbol/matchAll +tags: + - JavaScript + - Property + - Reference + - Symbol +translation_of: Web/JavaScript/Reference/Global_Objects/Symbol/matchAll +--- +<div>{{JSRef}}</div> + +<p><code><strong>Symbol.matchAll</strong></code> 返回一个迭代器,该迭代器根据字符串生成正则表达式的匹配项。此函数可以被 {{jsxref("String.prototype.matchAll()")}} 方法调用。</p> + +<div>{{EmbedInteractiveExample("pages/js/symbol-matchall.html")}}</div> + + + +<h2 id="描述">描述</h2> + +<div> +<p>此Symbol用于 {{jsxref("String.prototype.matchAll()")}} 特别是 {{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}}。下面两个例子返回相同的结果:</p> + +<pre class="brush: js">'abc'.matchAll(/a/); + +/a/[Symbol.matchAll]('abc');</pre> + +<p>此方法用于自定义 {{jsxref("RegExp")}} 子类中的匹配行为。</p> + +<p>{{js_property_attributes(0,0,0)}}</p> +</div> + +<h2 id="示例">示例</h2> + +<p>更多示例请查阅 {{jsxref("String.prototype.matchAll()")}} 和 {{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}}。</p> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">文档</th> + <th scope="col">状态</th> + <th scope="col">备注</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-symbol.matchall', 'Symbol.matchAll')}}</td> + <td>{{Spec2('ESDraft')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="浏览器支持">浏览器支持</h2> + + + +<p>{{Compat("javascript.builtins.Symbol.matchAll")}}</p> + +<h2 id="相关链接">相关链接</h2> + +<ul> + <li>{{jsxref("String.prototype.matchAll()")}}</li> + <li>{{jsxref("RegExp.@@matchAll", "RegExp.prototype[@@matchAll]()")}}</li> +</ul> |
