389 B
389 B
title
| 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
digits.
Spoiler Alert!! Solution Ahead!
Solution
let numRegex = /\d/g;
Explanation
- The
\dshorthand character is a shortcut for[0-9], it search for any number between 0 and 9.