freeCodeCamp/guide/english/certifications/javascript-algorithms-and-d.../regular-expressions/match-all-numbers/index.md

24 lines
389 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Match All Numbers
---
## Match All Numbers
## Hint 1
* A global flag will help you get through this challenge.
## Hint 2
* Try using a shorthand character for `d`igits.
# Spoiler Alert!! Solution Ahead!
## Solution
```javascript
let numRegex = /\d/g;
```
## Explanation
* The `\d` shorthand character is a shortcut for `[0-9]`, it search for any number between 0 and 9.