24 lines
		
	
	
		
			389 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
		
		
			
		
	
	
			24 lines
		
	
	
		
			389 B
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| 
								 | 
							
								---
							 | 
						||
| 
								 | 
							
								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.
							 |