Skip to content
Your text never leaves your browser

Regex Tester

Test your regex patterns. Cry about your regex patterns. Both valid uses.

Pattern
Flags
Test String
Results (2 matches)
Highlighted Matches
Contact us at [email protected] or [email protected] for help.
Match Details (2 matches)
Match 1: "[email protected]" at index 14
$1: "hello"
$2: "scratchpad"
$3: "page"
Match 2: "[email protected]" at index 39
$1: "support"
$2: "scratchpad"
$3: "page"

What this does

DEVS: new RegExp(pattern, flags) → String.matchAll(). Native JS regex engine. Be kind to it (avoid catastrophic backtracking).

Type a regex pattern, paste some test text, see what matches. Matches highlight inline so you can see exactly where they land in context. Capture groups show up in the details panel with their index, content, and position. The pattern runs live as you type.

Common use cases

Building and debugging patterns. You think your regex matches email addresses, but it's also matching @.com. Inline highlighting shows you exactly what's matching and what isn't, in real text, as you refine.

Testing capture groups. Wrap part of your pattern in parentheses and it becomes a group. /(\d4)-(\d2)-(\d2)/ on "2026-03-22" gives you three groups: "2026", "03", "22". Named groups work too. The details panel shows all captures for every match.

Quick validation against real data. Paste a log file, a CSV column, an HTML snippet. See if your pattern catches what it should and skips what it shouldn't.

Things to know

Flags matter. g (global) finds all matches, not just the first. i makes it case-insensitive. m (multiline) changes ^ and $ to match line boundaries instead of the whole string. s (dotAll) makes . match newlines too. Toggle them with a click.

Characters that need escaping: . * + ? ^ $ [ ] ( ) | \. These all have special meaning in regex. If you want a literal dot, write \. not .. Forgetting to escape is the most common regex bug. If your pattern matches way more than expected, check for unescaped special characters first.

Catastrophic backtracking is a real thing. Patterns with nested quantifiers like (a+)+$ can take exponentially long to fail on certain inputs. This tool runs your regex in a Web Worker with a timeout, so a bad pattern won't freeze the page. But if you see a timeout warning, your pattern needs restructuring.

This uses the JavaScript regex engine (ECMAScript). If you're writing patterns for Python, PHP, or Java, there are small differences. For most common patterns, it won't matter. For edge cases, test in the target language too.

Privacy

Your patterns and test strings never touch a server. Test against real data, production logs, whatever you need. We can't see any of it.