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.
Docs: https://mathiasbynens.be/notes/es-regexp-proposals#matchAll https://v8.dev/features/string-matchall