mirror of
https://github.com/alrayyes/wiki.git
synced 2024-12-01 15:26:23 +00:00
18 lines
315 B
Markdown
18 lines
315 B
Markdown
|
---
|
||
|
id: 32ffc92c-6a1d-4bf1-8f4c-b8d53ced6203
|
||
|
title: MatchAll Expression
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
Find all instances of a regular expression match, including the index.
|
||
|
|
||
|
# Syntax
|
||
|
|
||
|
``` javascript
|
||
|
const matches = "Here are some numbers: 5 12 88".matchAll(/\d+/g);
|
||
|
for (const match of matches) {
|
||
|
console.log(match);
|
||
|
}
|
||
|
```
|