The + quantifier repeats the previous token one or more times. It is one of the most common tools in regex: turn a single digit \d into a full number \d+, or a letter into a whole word with \w+. Master + and you can match runs of characters efficiently.
01
+
One or more
02
{1,}
Same meaning
03
Greedy
Max match
04
+?
Lazy mode
05
(ab)+
Group repeat
06
+ g
All runs
Fundamentals
Introduction
A single metacharacter like \d matches exactly one digit. Real data often contains runs of characters: phone numbers, prices, words, and repeated punctuation. The + quantifier solves this by saying “match the previous item again and again, at least once.”
For example, /\d+/ on "item42" matches "42", not just "4". Without +, you would need to write longer patterns or loop in JavaScript. With +, one concise regex captures the entire number token.
Concept
Understanding the + Quantifier
Place + immediately after a character, metacharacter, class, or group. It is greedy by default: the engine takes as many repetitions as possible while still allowing the rest of the pattern to succeed.
JavaScript
"a1b22c333".match(/\d+/g);
// ["1", "22", "333"]
"a".match(/a+/); // ["a"]
"".match(/a+/); // null — + requires at least one
Shorthand: + equals {1,} (minimum one, no maximum). Unlike *, which allows zero matches, + fails when the preceding token is absent.
💡
Beginner Tip
Add the global g flag when you want every run in a string, not just the first. "a1b22".match(/\d+/) returns only ["1"]; add g to get ["1", "22"].
Usage
How to Use the + Quantifier
Attach + to tokens you want to repeat, combine with anchors for validation, or use lazy +? for minimal matches:
JavaScript
/\d+/g; // all digit runs
/\w+/g; // all word runs
/\s+/g; // whitespace blocks
/(ha)+/g; // ha, haha, hahaha
/<.+?>/g; // lazy tag match
/^\d+$/; // whole string is digits
Use test() for presence checks, match() to extract runs, and replace(/\s+/g, " ") to collapse repeated spaces.
Foundation
📝 Syntax
JavaScript
token+ // one or more of token
\d+ // one or more digits
\w+ // one or more word chars
(group)+ // repeat entire group
token+? // lazy — as few as possible
token{1,} // equivalent to +
Common patterns
/\d+/g — extract all number tokens from text.
/\w+/g — pull words from a sentence.
/\s+/g — find whitespace runs for splitting or cleanup.
/^\d+$/ — validate a string contains only digits.
/(https?:\/\/\S+)/g — capture URL-like runs.
Cheat Sheet
⚡ Quick Reference
Goal
Pattern / API
One or more digits
\d+
One or more words chars
\w+
All runs in string
/pattern+/g
Repeat a group
(ab)+
Lazy (minimal) match
+?
Longhand form
{1,}
Compare
📋 + vs * vs ?
The three basic repetition quantifiers and when to use each.
+
token+
One or more — requires at least one
*
token*
Zero or more — optional repetition
?
token?
Zero or one — makes token optional
On ""
/a+/
Fails — + needs at least one a
Hands-On
Examples Gallery
Open DevTools Console (F12) or use Try-it links. Examples cover digit runs, word extraction, whitespace cleanup, greedy vs lazy matching, and repeating groups.
📚 Getting Started
Match runs of characters with +.
Example 1 — Extract Numbers with \d+
Find every sequence of one or more digits.
JavaScript
const text = "order 12 items for $49.99";
console.log(text.match(/\d+/)); // ["12"] — first run only
console.log(text.match(/\d+/g)); // ["12", "49", "99"]
\s+ matches one or more whitespace characters as a single unit. Replacing each run with one space normalizes the string without manual loops.
Example 4 — Greedy + vs Lazy +?
See how greediness affects tag-like matching.
JavaScript
const html = "<b>bold</b> and <i>italic</i>";
console.log(html.match(/<.+>/g));
// ["<b>bold</b> and <i>italic</i>"] — greedy spans too far
console.log(html.match(/<.+?>/g));
// ["<b>", "</b>", "<i>", "</i>"]
["<b>bold</b> and <i>italic</i>"]
["<b>", "</b>", "<i>", "</i>"]
How It Works
Greedy + takes as much as possible, so .+ runs from the first < to the last >. Lazy +? stops at the earliest valid point, matching each tag separately.
Example 5 — Repeat a Group with (ha)+
Apply + to a captured group for repeated sequences.
Lazy variants: *? and ?? follow the same minimal-match idea as +?.
Compatibility
Browser & Runtime Support
The + quantifier is part of core JavaScript regular expression syntax.
✓ Baseline · ES3+
RegExp + quantifier
Supported in every browser and Node.js version. Use + for one-or-more repetition of any token or group.
99%Universal syntax
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
+Excellent
Bottom line: Safe everywhere. + is the standard way to match runs of one or more characters.
Wrap Up
Conclusion
The + quantifier matches one or more of the previous token—turning single-character patterns into powerful run matchers like \d+, \w+, and \s+. It is greedy by default, equivalent to {1,}, and essential for extraction and validation.
Remember to add g for all matches, use +? when greedy matching goes too far, and wrap groups in parentheses when the whole group should repeat. Next, learn (?=...) positive lookahead.
Assume one + match equals the whole string without anchors
Nested greedy quantifiers on untrusted input without care
Match floats with \d+ alone—add \.\d+
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about the RegExp + quantifier
Match one or more repetitions with confidence.
5
Core concepts
🔢01
+
One or more.
Syntax
📈02
{1,}
Same rule.
Shorthand
📄03
Greedy
Max first.
Default
🔒04
+?
Minimal run.
Lazy
🚀05
+ g
All runs.
Extract
❓ Frequently Asked Questions
The + quantifier means one or more of the preceding token. For example, \d+ matches a sequence of one or more digits. It requires at least one match—unlike *, which allows zero.
+ requires at least one repetition of the previous token. * allows zero or more. So /a+/ fails on an empty string, but /a*/ succeeds (matching zero a characters).
Yes. The + quantifier is shorthand for {1,}, which means at least one and no upper limit. Both are greedy by default in JavaScript.
+ is greedy—it matches as many characters as possible. +? is lazy (non-greedy)—it matches as few as possible while still satisfying the one-or-more rule.
Yes. When placed after a group like (ab)+, it repeats the entire group one or more times. Example: (ha)+ matches ha, haha, hahaha.
The + quantifier is core JavaScript regex syntax since ES3. It works in every browser and Node.js version without polyfills.
Did you know?
The + quantifier is so common that many developers learn \d+ before they learn what \d alone does. Under the hood, + always applies to exactly one preceding token—parentheses let you treat a group as that single token for repetition.