Live matching
Every match is highlighted as you type, with its index, its length and each capture group — numbered and named.
RegexForge
Paste a pattern and a sample of text. RegexForge highlights every match, lists each capture group, explains the pattern token by token and hands you the same regex as JavaScript, Python, Go or Rust code. Everything runs in this browser tab — nothing is uploaded.
One click loads a pattern, its flags and a sample text.
Pattern and text never leave this tab.
Safe run: matching happens in a Web Worker and is cut off after 700 ms.
g globali ignore casem multilines dotAllu unicoded indicesy stickyIndex, length and every capture group.
No matches yet.
Uses $1, $2, $&, $
Type a replacement to preview the result here.
Every token, in the order the engine reads it.
Type a pattern to see it broken down token by token.
The same pattern, flags and replacement as runnable code.
Generated from your current pattern, flags and replacement.
The twenty-one tokens that cover most real patterns.
| Token | What it means | Example |
|---|---|---|
. | any single character except line breaks | a.c → abc |
^ | start of the string, or of a line with m | ^Hi |
$ | end of the string, or of a line with m | end$ |
* | zero or more of the previous item | ab* |
+ | one or more of the previous item | ab+ |
? | optional item, or lazy marker after a quantifier | colou?r |
{n,m} | between n and m repetitions | \d{2,4} |
[abc] | one character from the set | [aeiou] |
[^abc] | one character outside the set | [^0-9] |
\d | one digit | \d{3} |
\w | one word character | \w+ |
\s | one whitespace character | \s+ |
\b | word boundary | \bcat\b |
(...) | capturing group | (\d{4})-(\d{2}) |
(?:...) | non-capturing group | (?:ab)+ |
(?<name>...) | named capturing group | (?<year>\d{4}) |
(?=...) | lookahead | \d+(?= KRW) |
(?!...) | negative lookahead | \d+(?! KRW) |
(?<=...) | lookbehind | (?<=KRW )\d+ |
a|b | either alternative | cat|dog |
\1 | backreference to group 1 | (\w)\1 |
A tester, a teacher and a code generator in one static page.
Every match is highlighted as you type, with its index, its length and each capture group — numbered and named.
Matching runs in a Web Worker with a 700 ms cut-off, and nested quantifiers are flagged before they freeze the tab.
Classes, quantifiers, anchors, groups, lookarounds, backreferences and flags are broken down into readable steps.
Email, URL, Korean mobile, ISO date, IPv4, UUID and a Hangul + Latin filter, each with sample text.
Export to JavaScript, Python, Go and Rust, with a note wherever an engine lacks a feature your pattern uses.
No upload, no account, no analytics. Pattern, text and replacement stay in the browser and can be wiped in one click.
Three steps from a vague idea to a pattern you trust.
Type a pattern, or pick a preset and edit it. Paste a sample that includes both matches and near-misses.
Turn flags on and off and see where the pattern succeeds, where it stops and which groups captured what.
Check the explainer when a match surprises you, then copy the snippet for the language you are writing.
The things people ask before pasting a real pattern.
No. Matching, highlighting, explaining and code generation all run as JavaScript in this tab. The only external file on the page is the ad loader; the tester itself makes no network requests.
The browser's own JavaScript RegExp engine, so what you see here is what your JavaScript will do. Flags g, i, m, s, u, d and y are supported.
Some patterns backtrack exponentially on text that almost matches. RegexForge runs the match in a Web Worker and stops it after 700 ms, so the page stays responsive. Simplify nested quantifiers such as (a+)+ or (.*)* to fix the pattern itself.
Go's RE2 engine and Rust's regex crate are linear-time engines: they do not support lookarounds or backreferences. The exported snippet says so instead of failing silently. Python and JavaScript support them.
Only in this browser's localStorage: the theme and your last pattern, flags, text and replacement. Nothing is transmitted, and the Clear saved settings button removes it.
Yes. Ads keep the site running; the tool has no paid tier and no account.
Privacy
Patterns, sample text and replacements are processed in memory in this tab. The only stored data is your theme and last inputs, kept in localStorage on your own device.