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

25 lines
400 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Match All Non-Numbers
---
## Match All Non-Numbers
## Hint 1
* You should try using a global flag.
## Hint 2
* Try a shorthand character for non-digits characters.
# Spoiler Alert!! Solution Ahead!
## Solution
```javascript
let noNumRegex = /\D/g;
```
## Explanation
* The `\D` shorthand character is used to match non-digits characters, it has the same result as using `[^0-9]`;