Regex Tester
Test and debug your regular expressions in real-time. See matches highlighted, view capture groups, and toggle flags. Runs entirely in your browser - no data ever leaves your device.
//g
JavaScript regex syntax
Quick Reference
Characters
- . - Any character
- \d - Digit
- \w - Word char
- \s - Whitespace
Quantifiers
- * - 0 or more
- + - 1 or more
- ? - 0 or 1
- {n} - Exactly n
Anchors
- ^ - Start
- $ - End
- \b - Word boundary
Groups
- (abc) - Group
- (?:abc) - Non-capture
- [abc] - Char class
- a|b - Or
Regex Flags
gGlobal
Find all matches
iInsensitive
Ignore case
mMultiline
^ $ per line
sDot All
. matches \n
uUnicode
Unicode support
Common Patterns
Email
[a-z]+@[a-z]+\.[a-z]+URL
https?://[^\s]+Phone
\d{3}-\d{3}-\d{4}Zip Code
^\d{5}(-\d{4})?$Tips
- →Use global flag (g) to find all matches
- →Escape special chars: \. \[ \( etc.
- →Use (?:...) for non-capturing groups
- →Test edge cases and special characters
Related tools: Diff Checker · JSON Formatter · Hash Generator · Case Converter