MatchAll Expression
Description
Find all instances of a regular expression match, including the index.
Syntax
const matches = "Here are some numbers: 5 12 88".matchAll(/\d+/g)
for (const match of matches) {
console.log(match)
}
Find all instances of a regular expression match, including the index.
const matches = "Here are some numbers: 5 12 88".matchAll(/\d+/g)
for (const match of matches) {
console.log(match)
}