3 chars · 1 line
8 chars · 1 line
Pattern did not match the inputFlags: g
3 chars · 1 line
8 chars · 1 line
Regex repetition error
A bounded quantifier uses {min,max}. JavaScript rejects a range when min is greater than max, such as a{3,2}. This tool is free to use. No account or payment is required.
Last updated
{2,3} means at least two and at most three repetitions. Reversing those bounds describes an impossible interval, so JavaScript rejects the pattern.
Put the smaller count first.
a{3,2}a{2,3}Common questions
Yes. It means at least three repetitions with no explicit upper bound.
Yes. It means exactly three repetitions.
Yes, depending on context and escaping, but braces that form quantifier syntax must describe valid bounds.
Debugging a specific Regex issue? Browse Regex troubleshooting.