Regex Tester.
Live match highlighting, flags, capture groups, and replace mode.
Common patterns.
Ready-made expressions for the validations that come up most often.
| Pattern | Matches | Flags |
|---|---|---|
| \b[\w.+-]+@[\w-]+\.[\w.]+\b | Email address | gi |
| https?:\/\/[^\s]+ | URL | gi |
| \+?1?[-.\s]?\(?[2-9]\d{2}\)?[-.\s]?\d{3}[-.\s]?\d{4} | Phone (US) | g |
| \b(?:\d{1,3}\.){3}\d{1,3}\b | IPv4 address | g |
| \b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b | Date (YYYY-MM-DD) | g |
| #(?:[0-9a-fA-F]{3}){1,2}\b | Hex colour | g |
| <[^>]+> | HTML tag | gi |
| ^\s*$ | Whitespace only lines | gm |
Capabilities
What You Get
See what your expression actually matches as you type it, including every capture group and a live replace preview.
Live Highlighting
Matches are highlighted in your test string as you edit the pattern.
Capture Groups
Every group is listed per match, numbered and named.
Flag Toggles
Switch global, case-insensitive, multiline, and dotall independently.
Replace Mode
Preview a substitution before running it anywhere real.
Pattern Library
Start from tested expressions for email, URL, phone, and more.
Runs Locally
Your test data never leaves the browser — safe for real samples.
Related tools.
More free browser-based utilities, connected by category and use case.
JSON Formatter & Diff
Paste raw or minified JSON to format, validate, and syntax-highlight it. Switch to diff mode to compare two JSON blobs side by side and see exactly what changed.
JWT Decoder
Paste any JSON Web Token and instantly see the decoded header, payload, expiry, and issued-at date in a clean readable layout. Runs entirely in the browser — nothing sent anywhere.
Cron Expression Builder
Visual builder for cron schedule expressions. Configure minute, hour, day, month, and weekday visually and see the human-readable description update live. Copy for n8n, GitHub Actions, or crontab.
FAQ
Regex Tester FAQ.
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Used in programming and text processing, regex can match specific strings, validate formats (email, phone), extract data, and perform complex find-and-replace operations in a single line.
What do the flags mean?
g (global) finds all matches instead of stopping at the first. i (case-insensitive) matches regardless of case. m (multiline) makes ^ and $ match line boundaries. s (dotall) makes . match newline characters too. You can combine flags.
What is a capture group?
A capture group is a part of the pattern wrapped in parentheses (). When the regex matches, each group captures the text it matched. For example, in (\d{4})-(\d{2})-(\d{2}), three groups would capture the year, month, and day separately from a date string.
How do I use the replace mode?
Switch to 'Replace' mode, write your pattern in the regex box, type the replacement string below the test area, and see the result instantly. You can reference capture groups in the replacement using $1, $2, etc.
Why is my regex matching too much?
You may need quantifier constraints. .* matches any characters greedily. Use .*? for non-greedy matching, or be more specific with your character classes. For example, to match a word, use \w+ rather than .+.
How do I match a literal dot or bracket?
Escape them with a backslash: \. matches a literal dot, \( and \) match literal parentheses. The tool's pattern input treats \. as a literal dot just as JavaScript's RegExp constructor does.













