- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Regex Quantifiers
JavaScript Regular Expressions
JavaScript Regex Quantifiers
Quantifiers say how many times a pattern should repeat.
Without one, a pattern matches exactly one character.
Quantifiers turn that into one or more, none or more, or an exact count.
Example
Example
javascript
console.log(/\d+/.test("abc"));
console.log("room 42".match(/\d+/)[0]);