3 chars · 1 line
8 chars · 1 line
3 chars · 1 line
8 chars · 1 line
Regex quantifier error
Quantifiers modify the token immediately before them. A pattern beginning with * has no preceding atom, so JavaScript rejects it before matching starts. This tool is free to use. No account or payment is required.
Last updated
The operators *, +, ?, and valid {n,m} forms are postfix operators in JavaScript regex syntax. They need an atom on their left before the pattern can compile.
Put the quantifier after the token it should repeat.
*abca*bcCommon questions
Yes. Escape it as \* when the asterisk is data rather than a quantifier.
Yes. + and ? also require a preceding atom when used as quantifiers.
The regex does not compile, so JavaScript cannot begin matching the input text.
Debugging a specific Regex issue? Browse Regex troubleshooting.