Regex Validator — Validate Your Regular Expression Syntax

Type or paste any regular expression to validate its syntax instantly. The tool checks every character as you type and shows clear error messages with fix suggestions.

Regex Syntax Rules

Regular expressions follow precise syntax rules. Special characters (. * + ? ^ $ { } [ ] | ( ) \) have meaning and must be escaped with a backslash when you want them as literals. Parentheses must be balanced. Character classes must be closed. Quantifiers need a preceding element to repeat. This tool checks all these rules in real-time.

JavaScript vs Other Regex Engines

This validator uses JavaScript's RegExp engine, which supports: named groups (?<name>...), lookbehind (?<=...), the s (dotAll) flag, and Unicode property escapes. Features not supported: atomic groups, possessive quantifiers, conditional patterns, and recursive patterns (available in PCRE/PHP).

Tips for Writing Valid Patterns

Build patterns incrementally — start with a simple match and add complexity one piece at a time. Use non-capturing groups (?:...) when you don't need the capture. Be specific with character classes instead of relying on .*. Test against both matching and non-matching inputs to verify your pattern doesn't over-match.

Enter your regex below to validate it.

/
/g
✅ Valid pattern
No matches

Plain-English Breakdown

(Start of capturing group 1
\wMatch any word character (letter, digit, _)
+One or more times
)End of group
\sMatch any whitespace
(Start of capturing group 2
\wMatch any word character (letter, digit, _)
+One or more times
)End of group