Developer Tool

Regex Tester & Debugger

Build and test regular expressions with live match highlighting, group captures, replace mode, and a full quick-reference cheat sheet.

/ /
Flags:
Test String 0 matches
Replace:
Match Results
Enter a pattern and test string to see matches
Quick Reference — click to insert
.Any character
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word char
\sWhitespace
\SNon-whitespace
^Start of string
$End of string
\bWord boundary
*0 or more
+1 or more
?0 or 1 (optional)
{n,m}Between n and m times
()Capture group
(?:)Non-capture group
(?=)Positive lookahead
(?!)Negative lookahead
[a-z]Character range
[^abc]Negated class
a|bAlternation (or)
\nNewline
EmailEmail address pattern
URLURL pattern
DateYYYY-MM-DD date
PhoneUS phone number
Hex ColorCSS hex color
IPIPv4 address

The Most Powerful Online Regex Tester

Everything you need to master regular expressions

🎨

Live Match Highlighting

Matches are highlighted in real-time directly in your test string — different colors for each match number.

🔍

Group Capture Display

See every captured group for every match — their index, value, and position in the string.

🔄

Replace Mode

Test find-and-replace operations with support for back-references like $1, $2 for captured groups.

📖

Built-in Cheat Sheet

Click any pattern from the quick reference to insert it instantly. Includes common email, URL, and date patterns.

Frequently Asked Questions

What does the 'g' flag do?
The global flag makes the regex find all matches instead of stopping at the first one. Without it, only the first match is found.
How do I use captured groups in replace?
In replace mode, use $1, $2, etc. to reference captured groups. For example, pattern (\w+) (\w+) with replacement $2 $1 would swap two words.
What flavour of regex is used?
This tool uses JavaScript's built-in RegExp engine (ECMAScript), which supports most common regex features including lookaheads, named groups, and unicode mode.
What does the 's' flag do?
The dotAll flag makes the dot (.) match any character including newlines. By default, the dot does not match line breaks.