Quick answer
When Regex is enabled, the pattern is interpreted as a JavaScript regular expression.
Error Pattern Invalid Regex
When Regex is enabled, the pattern is interpreted as a JavaScript regular expression. Invalid syntax (unclosed brackets, bad escapes, invalid quantifiers) causes an error and no matches are returned.
Common causes
- Unclosed bracket or parenthesis (e.g. (error without closing ).
- Invalid escape (e.g. \k when not a valid backreference).
- Quantifier on nothing (e.g. * or + at start, or | without left/right side).
How to fix
- Balance all ( ) [ ] { } in the regex.
- Use valid escape sequences. For literal backslash use \\. For word boundary use \b.
- Test the pattern in Regex Tester first to see the exact error message.
Examples
Bad
[error
Good
[ERROR]
FAQ
- Where can I test my regex?
- Use the Regex Tester tool on this site to validate the pattern and see matches before using it in Error Pattern Checker.
Fix it now
Try in validator (prefill this example)