Regex Visualizer and Tester: Client-Side, No Data Sent
Test regex in your browser. Your data stays private.
This regex tester runs entirely in your browser. Your test strings, patterns, and data stay on your device from start to finish. Paste a pattern, add your test string, and see every match highlighted in real time with full group capture breakdown. No server round-trips, no data exposure, no account required.
Match list
#1 [8, 25)
[email protected]#2 [26, 43)
[email protected]
Regex is executed in your browser only. Keep in mind that some patterns can be slow on large text.
How this tool works
The regex visualizer displays a finite automaton diagram of your regular expression, highlights match positions on a test string, and shows a captured groups table in real time as you type. The diagram uses an NFA (nondeterministic finite automaton) representation: each circle is a state, each directed arrow is a character class or literal that triggers a transition, and the accepting state is double-circled. Quantifiers (*, +, ?, {n,m}) expand into epsilon-connected loops in the NFA graph. Named capture groups appear as labeled subgraph clusters. The match table shows each match's full value, start and end index, and the value of each positional and named capture group. A flavor selector controls which regex features are active: JavaScript mode supports the v flag for Unicode property escapes such as \\p{Letter}; Python mode follows re module semantics where \\w includes Unicode word characters by default. Key assumption: the visualizer renders the logical NFA structure, not the optimized DFA that most production regex engines execute internally. The diagram shows correctness, not performance characteristics. Edge case: catastrophic backtracking occurs when a regex with nested quantifiers matches a long input that ultimately fails. The tool highlights quantifier-over-quantifier patterns such as (a+)+ that are vulnerable to exponential execution time, so you can refactor before deploying to a production service.
Worked example
Pattern: (\d{4})-(\d{2})-(\d{2}). Flags: g. Test string: Release date: 2026-05-28 and 2025-12-01. The tool returns two matches. Match 1: 2026-05-28 at position 14, groups year=2026, month=05, day=28. Match 2: 2025-12-01, groups year=2025, month=12, day=01. With replacement string $<day>/$<month>/$<year>, the preview shows: Release date: 28/05/2026 and 01/12/2025.
Frequently asked questions
Does this tool support PCRE, Python, or Go regex syntax?
No. The tool runs JavaScript's native RegExp engine. JavaScript regex is similar to PCRE but not identical. Constructs that PCRE supports but JavaScript does not include atomic groups, possessive quantifiers, and the x free-spacing flag. Python uses named group syntax (?P<name>...) while JavaScript uses (?<name>...). Go's regexp package (RE2) forbids lookaheads and backreferences entirely.
What does \\\"catastrophic backtracking\\\" mean and why did the tool time out?
Catastrophic backtracking happens when a pattern with nested or overlapping quantifiers tries exponentially many ways to match a string before concluding there is no match. A classic example is (a+)+ applied to many a characters followed by a non-matching character. The tool aborts execution after 1,500 milliseconds and reports the timeout rather than freezing your browser.
Can I save regex patterns for later?
Not in the current version. Pattern saving to browser localStorage is planned for a future update. For now, the URL does not persist your pattern or test string between sessions, so keep patterns you want to reuse in a local file or notes app.
What is the difference between the m (multiline) and s (dotAll) flags?
The m flag changes what ^ and $ mean: without m, they match the very start and end of the entire string; with m, they match the start and end of each individual line. The s flag (dotAll) changes what . matches: without s, the dot matches any character except a newline; with s, the dot matches any character including newlines.
How do I match a literal dot, bracket, or other special character?
Escape it with a backslash: \\\\. matches a literal dot, \\\\[ matches a literal opening bracket, \\\\( matches a literal opening parenthesis. Inside a character class [...], most special characters lose their special meaning, but the closing bracket ], backslash \\\\, caret ^ at the start, and hyphen - between characters still need escaping.
Why does the tool show undefined for some capture groups?
When a pattern contains alternation and one branch has more capture groups than another, the groups from the branch that did not match are undefined. The tool shows undefined explicitly rather than an empty string so you can tell the difference between a group that matched an empty string and a group that was never attempted.