Regex Tester
Test regular expressions with live match highlighting, flags and capture groups.
Test regular expressions live
The Regex Tester lets you build and debug regular expressions with instant feedback. Type a pattern, toggle flags, and paste test text to see every match highlighted in real time, along with the count and capture groups. It uses your browser's own JavaScript regex engine, so what you see is exactly how it behaves in code.
What is a regular expression?
A regular expression (regex) is a pattern that describes a set of strings. Regex is used everywhere — validating input, searching and replacing text, scraping data, and parsing logs. The syntax is powerful but easy to get wrong, which is why testing interactively against real examples saves so much time.
How to use it
- Enter your pattern between the slashes.
- Toggle flags: g (global), i (ignore case), m (multiline), s (dotall).
- Paste test text and watch matches highlight live.
Common regex flags
| Flag | Meaning |
|---|---|
| g | Find all matches, not just the first |
| i | Case-insensitive matching |
| m | ^ and $ match line starts/ends |
| s | Dot (.) also matches newlines |
Quick syntax reference
\ddigit,\wword char,\swhitespace.+one or more,*zero or more,?optional.[abc]character set,(...)capture group,|alternation.^start,$end,\bword boundary.
Capture groups
Parentheses create capture groups that extract parts of a match — invaluable for pulling fields out of structured text. This tester shows the captured groups from the first match, so you can confirm your groups line up before using them in code with methods like match(), matchAll(), or replace().
Private and free
Everything runs in your browser using the native regex engine — your patterns and text are never uploaded. The tool is completely free with no sign-up.
Frequently asked questions
Which regex flavor does it use?
JavaScript's built-in regex engine, so results match exactly how the pattern behaves in JS code.
What do the flags do?
g matches all occurrences, i ignores case, m makes ^/$ work per line, and s lets the dot match newlines.
Does it show capture groups?
Yes. It lists the capture groups from the first match so you can verify your parentheses.
Is my data private?
Yes. Everything runs in your browser and nothing is uploaded.