Utilities
Regex Tester
Test Your Pattern
Quick Presets
Email
URL
IPv4
Phone (US)
Date (YYYY-MM-DD)
Hex Color
HTML Tag
/
/
Tool features
4 features
Real-time Testing
Matches update as you type with 300ms debounce
Capture Groups
View numbered and named capture group values
Replace Mode
Preview regex-based text replacements instantly
Common Presets
One-click patterns for email, URL, IP, phone and more
What is a regular expression & how it works
A regular expression (regex) is a pattern that describes text: character classes like \d for digits, quantifiers like + and {2,4}, anchors like ^ and $, and groups in parentheses that capture parts of a match.
This tester uses your browser's JavaScript regex engine, highlighting matches and capture groups live as you type, with the g, i, m, s and u flags and a replace mode. Patterns behave the same in Node.js; other languages such as PCRE, Python and Java differ in some syntax details.
Capture group
( … ) saves the matched text for backreferences and replacements ($1, $2).
Flags
g all matches, i case-insensitive, m multiline anchors, s dot matches newlines, u Unicode.
Greedy vs lazy
.* takes as much as possible; .*? takes as little as possible.
How to use this tool
1
Enter a pattern
Type the regex, or start from a preset such as email, URL or IPv4.
2
Set the flags
Toggle g, i, m, s and u to match the behaviour you need.
3
Add test text
Paste sample text; matches and capture groups highlight as you type.
4
Try replacements
Switch to Replace mode and use $1, $2 to reuse captured groups.
Related tools
3 tools
JSON Formatter & Validator
Format, validate and minify JSON online with proper indentation and error detection
URL Encoder / Decoder
Encode and decode URLs online — convert special characters to percent-encoding with batch mode and encodeURIComponent or encodeURI support
Base64 Encoder Decoder
Encode and decode text or data to/from Base64 format with file support
Frequently asked questions
5 Q&A
Add the
g (global) flag to find every match instead of stopping at the first.Without the
m flag, ^ and $ match only the start and end of the whole text. Turn on m to make them match at line breaks.Escape it with a backslash:
\., \[, \(. Inside a character class most characters are literal, e.g. [.].Nested quantifiers such as
(a+)+ can cause catastrophic backtracking on non-matching input. Make patterns more specific or avoid nesting repetition.