Regular Expression Tester Online
Test regular expressions with real-time match highlighting, capture groups, and a library of common patterns for email, URL, IP, and more.
Pattern Library
How to Use
- 1
Enter pattern
Type your regex pattern and optional flags (g, i, m).
- 2
Add test text
Enter sample text. Matches highlight instantly as you type.
- 3
Browse patterns
Load common patterns like email, URL, IP, or phone validation from the library.
FAQ
How do I match a space in regex?
Use \s to match any whitespace (space, tab, newline) or a literal space character. \S matches non-whitespace. For only spaces (not tabs/newlines), use the literal space character or [ ] in a character class.
What is a regex wildcard?
The dot (.) is the regex wildcard — it matches any single character except newline. Use .* to match zero or more of any character. Use [\s\S]* to match anything including newlines.
How do I handle special characters in regex?
Escape special regex characters with a backslash: \. \* \+ \? \( \) \[ \] \{ \} \^ \$ \| \\. Inside character classes [], most specials lose their meaning except ] \ ^ -.
What is a negative lookahead?
Negative lookahead (?!pattern) asserts that what follows does NOT match the pattern. Example: foo(?!bar) matches "foo" only when NOT followed by "bar". It is zero-width (consumes no characters).
How do I make regex case insensitive?
Add the "i" flag to your regex: /pattern/i in JavaScript. In this tool, type "i" in the flags field. This makes [a-z] also match uppercase letters and vice versa.