← Back to release summary

RegExp String.prototype.matchAll()

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 73)
Intent stage
None

Summary

String.prototype.matchAll() behaves similarly to String.prototype.match(), but returns a full regexp result object for each match in a global or sticky regexp. This offers a simple way to iterate over matches when access to, for example, capture groups is needed.

Standards & signals

Docs: https://mathiasbynens.be/notes/es-regexp-proposals#matchAll https://v8.dev/features/string-matchall

View on chromestatus.com