Regex Tester.

Live match highlighting, flags, capture groups, and replace mode.

/
/gi
2 matches
Contact us at support@example.com or sales@company.org for help.

Common patterns.

Ready-made expressions for the validations that come up most often.

PatternMatchesFlags
\b[\w.+-]+@[\w-]+\.[\w.]+\bEmail addressgi
https?:\/\/[^\s]+URLgi
\+?1?[-.\s]?\(?[2-9]\d{2}\)?[-.\s]?\d{3}[-.\s]?\d{4}Phone (US)g
\b(?:\d{1,3}\.){3}\d{1,3}\bIPv4 addressg
\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\bDate (YYYY-MM-DD)g
#(?:[0-9a-fA-F]{3}){1,2}\bHex colourg
<[^>]+>HTML taggi
^\s*$Whitespace only linesgm

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.

All Tools

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.