Symbol.matchAll

翻译不完整。 请帮助我们翻译这篇文章!

Symbol.matchAll 返回一个迭代器,该迭代器根据字符串生成正则表达式的匹配项。此函数可以被 String.prototype.matchAll() 方法调用。

描述

此Symbol用于 String.prototype.matchAll() 特别是 RegExp.prototype[@@matchAll]()。下面两个例子返回相同的结果:

'abc'.matchAll(/a/);

/a/[Symbol.matchAll]('abc');

此方法用于自定义 RegExp 子类中的匹配行为。

Symbol.matchAll 属性的属性特性:
writable false
enumerable false
configurable false

示例

更多示例请查阅 String.prototype.matchAll()RegExp.prototype[@@matchAll]()

规范

文档 状态 备注
ECMAScript (ECMA-262)
Symbol.matchAll
Living Standard  

浏览器支持

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
matchAllChrome Full support 73Edge Full support 79Firefox Full support 67IE No support NoOpera Full support 60Safari Full support 13WebView Android Full support 73Chrome Android Full support 73Firefox Android Full support 67Opera Android Full support 52Safari iOS Full support 13Samsung Internet Android No support Nonodejs Full support 12.0.0

Legend

Full support  
Full support
No support  
No support

相关链接