Regex Tester & Debugger

Write a pattern, pick your flags, and see every match and capture group highlighted instantly.

Regex Tester

🔒 Nothing you enter is sent anywhere or stored. All processing happens in your browser.

How it works

A regular expression is a compact pattern for finding and extracting text — email addresses, phone numbers, tags, anything with a repeatable shape. Getting one right usually means trial and error, and this tester gives you that loop instantly: type a pattern, paste sample text, and watch every match light up as you go.

Enter your pattern (no surrounding slashes needed) and the flags you want — g for all matches, i for case-insensitive, m for multiline, s for dot-matches-newline. Matches are highlighted in place and each match's capture groups are listed below, so you can see exactly what $1, $2 and so on captured.

It uses the same JavaScript regex engine your code runs, so what works here works in your app. All matching happens locally — your test data is never uploaded.

Examples

Pattern \d{4} with text "Year 2026" → highlights 2026.
Pattern (\w+)@(\w+) → capture groups show the name and domain separately.
Add flag i so cat also matches "Cat" and "CAT".

Frequently asked questions

Which regex flavour is this?
JavaScript (ECMAScript) regular expressions — the same engine used in the browser and Node.js. Most patterns are portable, but some PCRE-only features won't apply.
Do I need to add slashes around the pattern?
No. Type just the pattern, and set flags like g, i, m in the separate flags box.
Why does my empty-match pattern behave oddly?
Patterns that can match an empty string are advanced; the tester advances past zero-length matches to avoid infinite loops, which is standard behaviour.
Is my test text sent anywhere?
No — the pattern runs against your text entirely in the browser, so nothing is uploaded.