Test Regular Expressions Live, Privately
Type a pattern and a test string, and matches highlight as you type — no submit button, no round trip to a server. Everything runs client-side on a WebAssembly build of Rust's regex engines, so your text and pattern stay on your device the entire time.
The Copy link button packs your pattern, flags and test string into the URL's hash fragment (the part after #). Browsers never send the hash portion of a URL to a server on page load, so a shared link still keeps your data local to whoever opens it — nothing round-trips through us in either direction.
How to Use This Tool
- Write a pattern — Type or paste a regular expression into the Pattern field. Syntax errors are reported inline as you type.
- Set flags — Toggle
i(case-insensitive),m(multi-line anchors),s(dot matches newline) andx(verbose, ignores whitespace and allows#comments) to change how the pattern is interpreted. - Add a test string — Paste text directly, or use "Load from file" for larger inputs. Matches, groups and their spans are highlighted live.
- Explore the tabs — Match shows each match with its numbered and named groups; Replace rewrites the text using a replacement template; List extracts just the matched values, one per line; Explain breaks the pattern down piece by piece in plain language.
- Share or export — Copy a permalink that reproduces your exact pattern, flags and test string, or copy the replaced/listed output directly.
Linear-Time by Design
Most regex tools use a backtracking engine, which can take exponential time on adversarial input — the classic ReDoS (Regular Expression Denial of Service) problem, where a pattern like nested quantifiers can freeze a page or a server for seconds or minutes on a short, deliberately crafted string.
This tester avoids that by defaulting to Rust's linear-time regex engine wherever the pattern allows it. That engine guarantees matching time grows proportionally with input length — never exponentially — no matter what the pattern looks like. For the vast majority of patterns (character classes, quantifiers, alternation, groups, anchors) this is the engine that runs, and the badge next to the pattern field reads "Linear-time" to confirm it.
Two constructs fall outside what a linear-time engine can express: lookaround (lookahead/lookbehind) and backreferences. When your pattern uses either, the tool automatically switches to a bounded backtracking engine — still fully functional, but with a hard cap on backtracking steps. If a pathological pattern would otherwise run away, it stops with a clear error instead of freezing your browser tab. The badge then reads "Bounded backtracking" so you always know which engine compiled your pattern and why.
Flags Reference
The tester follows Rust's regex flag semantics:
| Flag | Name | Effect |
|---|---|---|
i | case-insensitive | Matches letters regardless of case |
m | multi-line | ^ and $ match at the start/end of each line, not just the whole string |
s | dot-matches-all | . matches newline characters too (normally it doesn't) |
x | verbose/extended | Whitespace in the pattern is ignored and # starts a comment, so you can format complex patterns readably |
Flags combine freely — for example im together for a case-insensitive, multi-line match.
Replace and List Modes
The Replace tab rewrites your test string using a replacement template in a code fence like:
$1-$2
Numbered groups are referenced as $1, $2, and so on in match order. Named groups defined with (?P<name>...) are referenced with the dollar-sign brace form:
${name}
The List tab strips away the surrounding text and shows just the matched substrings, one per line — handy for pulling every email address, URL or ID out of a block of text without writing a replacement template.
The Explain Tab
Regex syntax is dense, and even a pattern you wrote yourself can be hard to re-read weeks later. The Explain tab walks through your pattern token by token — character classes, quantifiers, groups, anchors and flags — as a plain-language tree, so you can confirm the pattern actually does what you intended before you rely on it in code.
Working With Other Text Formats
If your regex work is really about massaging structured data rather than free text, the JSON Formatter is a natural next stop — it validates, pretty-prints and lets you query JSON directly in the browser with the same zero-upload approach used here.