Regex tester — offline
JavaScript regular expressions with live highlighting and capture groups. Your sample data never leaves the page.
Test regular expressions without uploading your sample data
Nobody tests a regex against invented strings. You test it against the thing it has to handle: a chunk of production log, a customer list, an export with real email addresses and account numbers. That sample data is the sensitive part, and it is what online regex testers quietly receive along with the pattern.
The pattern runs here with your browser's own JavaScript RegExp engine, on this page. Matches highlight live as you type, capture groups are broken out per match below, and none of it is transmitted — the site has no backend, and a Content-Security-Policy blocks third-party requests.
Which regex flavour this is
This is JavaScript (ECMAScript) regex, including named capture groups, lookbehind, and the u flag — the same engine that will run your pattern in the browser or in Node.js, so what you see here is what your code will do.
Flavours differ more than people expect, so a pattern verified here may behave differently in PCRE, Python's re, Go's RE2, or a database. Common divergences include lookbehind support, the exact syntax for named groups, whether . crosses newlines, and how Unicode properties are spelled. RE2-based engines deliberately omit backreferences and lookaround entirely. If the pattern is destined for another language, verify it there before shipping.
Catastrophic backtracking, and why a pattern can hang
If a complex pattern briefly freezes the page, you have found something genuinely worth knowing. That is catastrophic backtracking: nested or overlapping quantifiers — the classic shape being (a+)+ — force the engine to try an exponential number of ways to match a string that ultimately fails.
This is a property of the pattern itself, not of this page. A pattern that hangs here will hang in your application too, and if it runs against user-supplied input it is a denial-of-service vulnerability known as ReDoS. Far better to discover it now than in production.
The usual fixes are to avoid nesting quantifiers, make inner quantifiers possessive or atomic where your engine supports it, anchor the pattern so failures are detected early, and be specific rather than leaning on .*. Related tools that also stay on your device: diff checker, text sorter, and JSON formatter.
How to test a regular expression offline
- 1
Type a pattern and pick flags.
- 2
Paste sample text — matches highlight live.
- 3
Inspect capture groups per match below.
Regex Tester — frequently asked questions
Is my test data sent to a server?
No — the pattern runs with your browser's own JavaScript RegExp engine, right on this page. Log excerpts and sample data stay on your machine.
Which regex flavor is this?
JavaScript (ECMAScript) — including named groups, lookbehind, and the u flag. Patterns may behave slightly differently in PCRE or Python.
Why does a complex pattern freeze briefly?
Catastrophic backtracking is a property of the pattern itself. If a pattern hangs here it would hang in your code too — which is useful to know before shipping it.