Online Regex Tester

Build, test, and debug regular expressions with live match highlighting, capture-group inspection, and search-and-replace — all client-side.

//g

Highlighted matches

Matches will be highlighted here.

Matches

Enter a regular expression to start matching.

Regex quick reference

Character classes

.
Any character except newline
\d
Digit (0–9)
\D
Non-digit
\w
Word character (a-z, A-Z, 0-9, _)
\W
Non-word character
\s
Whitespace
\S
Non-whitespace
[abc]
Any of a, b, or c
[^abc]
Not a, b, or c
[a-z]
Character range

Anchors & boundaries

^
Start of string (or line with m)
$
End of string (or line with m)
\b
Word boundary
\B
Non-word boundary

Quantifiers

*
0 or more
+
1 or more
?
0 or 1 (optional)
{n}
Exactly n times
{n,}
n or more times
{n,m}
Between n and m times
*?
Lazy — as few as possible

Groups & lookaround

(abc)
Capturing group
(?:abc)
Non-capturing group
(?<name>abc)
Named capturing group
a|b
Alternation (a or b)
(?=abc)
Positive lookahead
(?!abc)
Negative lookahead
(?<=abc)
Positive lookbehind
(?<!abc)
Negative lookbehind

Your Data Never Leaves Your Device

Every tool runs entirely in your browser. Nothing you type is uploaded, stored, or logged on our servers.

100% Client-Side

The Regex Tester is an online playground for building, testing, and debugging regular expressions right in your browser. Type a pattern, toggle the g, i, m, s, u, and y flags, and watch every match light up in your test string in real time. Each match card breaks down the full match plus its numbered and named capture groups, so you can see exactly what your expression is capturing.

Switch to the Replace tab to preview search-and-replace results using replacement templates like $1, $<name>, and $&. Load one of the built-in common patterns — email, URL, IPv4, hex color, dates, and more — as a starting point, or keep the quick cheatsheet handy while you work. The tool uses your browser's native JavaScript (ECMAScript) regex engine, so your patterns and test data never leave your device.

FAQ

It uses the JavaScript (ECMAScript) regex engine built into your browser, including support for named capture groups, lookbehind, and the u (unicode) and s (dotAll) flags.

g finds all matches instead of just the first, i makes matching case-insensitive, m lets ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode mode, and y (sticky) matches only from the last position.

Each match card lists every numbered group ($1, $2, …) and any named groups you defined with (?<name>…), so you can confirm exactly what your pattern captured.

Switch to the Replace tab and enter a replacement template. Use $1 or $<name> to insert captured groups and $& for the entire match. Enable the g flag to replace every occurrence.

No. Everything runs entirely in your browser using the native regex engine — your patterns and test strings never leave your device.

Common causes are a missing g flag (only the first match shows), a case mismatch (add the i flag), or unescaped special characters like . + ( ) that need a backslash to match literally.