Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

String.prototype.matchAll()

2 tags 1 category

The matchAll() method of String values returns an iterator of all results matching this string against a regular expression, including capturing groups.

The implementation of String.prototype.matchAll doesn’t do much other than calling the Symbol.matchAll method of the argument with the string as the first parameter (apart from the extra input validation that the regex is global). The actual implementation comes from RegExp.prototype[Symbol.matchAll](/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/Symbol.matchAll).

Return value: An iterable iterator object (which is not restartable) of matches or an empty iterator if no matches are found. Each value yielded by the iterator is an array with the same shape as the return value of RegExp.prototype.exec().

Syntax example: matchAll(regexp)

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…