Skip to main content

Regex Visualizer

Test regular expressions with live match highlighting. See every match color-coded in your test string, inspect capture groups and named groups, toggle flags interactively, and use presets for common patterns like email, IPv4, and dates. Runs in your browser.

✓ 60K+ developers trust DevPlaybook ✓ Match highlighting + group capture ✓ Named groups + all flags

Frequently Asked Questions

What is a regex capture group?▼

A capture group is a part of a regex pattern wrapped in parentheses, like (\d+). It 'captures' the matched text so you can reference it separately from the full match. For example, in (\d{4})-(\d{2}), the first group captures the year and the second captures the month. Capture groups are numbered left to right by their opening parenthesis.

What is a named capture group?▼

A named capture group uses the syntax (?<name>pattern) to give a group a human-readable name instead of just a number. For example, (?<year>\d{4})-(?<month>\d{2}) lets you access the year and month by name in your code. Named groups make complex regexes much more readable and maintainable.

What do the regex flags mean?▼

The common flags are: g (global) — find all matches, not just the first; i (case-insensitive) — match uppercase and lowercase the same; m (multiline) — ^ and $ match start/end of each line; s (dotall) — the dot (.) matches newlines too; u (unicode) — enables full Unicode support including \p{} properties. You can combine flags freely.

What is the difference between regex-visualizer and regex-tester?▼

The Regex Visualizer focuses on showing you exactly what each match and capture group contains, with color-coded highlighting for multiple matches. The Regex Tester lets you run assertions (expected match / no-match) to build a test suite for your patterns. Use the visualizer to debug and understand a regex, and the tester to validate it against known cases.

Why does my regex match too much or too little?▼

Common causes: missing the g flag (only finds first match), greedy vs lazy quantifiers (use +? or *? for lazy), forgetting to escape special characters like . () [] with a backslash, and anchor misuse (^ and $ match line start/end in multiline mode but string start/end otherwise). Try the presets to see working examples, then modify from there.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →