Regex Tester (2026)
Test regular expressions with live highlighting, capture groups, and match indices. Toggles g/i/m/s/u flags. Uses native JavaScript RegExp — same engine as your code.
Email me at hello@specway.com or support@example.org. Not an email: alice@.com or @broken.io.
- 1. hello@specway.com @ 12groups: [1] hello, [2] specway.com
- 2. support@example.org @ 33groups: [1] support, [2] example.org
How the tester works
The pattern is compiled with new RegExp(pattern, flags) — the same engine your JavaScript code uses. Matches are walked with .exec() in a global loop and shown live as you type. The tester capped at 1000 matches to prevent runaway patterns from freezing the page.
Patterns developers write all the time
- Email:
\b[\w.+-]+@[\w-]+\.[\w.-]+\b - URL:
https?://[\w./?=&%~+:#-]+ - UUID v4:
[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12} - ISO date:
\d{4}-\d{2}-\d{2} - Hex color:
#[0-9a-fA-F]{3,8}
When NOT to use regex
Parsing HTML, JSON, or any nested structure. Regex is a flat-text engine — it can't count balanced brackets or distinguish "real" tags from text in comments. Use a real parser (DOMParser, JSON.parse, dedicated lib) for anything with structure. Regex is for flat patterns: emails, IDs, log lines, prefix extraction.