Great Scott Labs

Regex Tester

Build and test a regular expression against your own text, live. It runs entirely in your browser, so the file never leaves your computer.

Runs on your device Nothing is uploaded · works offline once loaded Open in new tab ↗
One file, and it is the whole program. The download is an .html file that opens in your browser — save it somewhere you’ll find it again and it keeps working with no internet, forever. Download this tool ↓

The loop this replaces

Writing a regular expression by editing your code, running it, reading the output, and guessing again is slow and discourages the small experiments that actually teach you the pattern.

Paste your real text here instead. Every match highlights as you type, each one listed with its position and its capture groups. You converge on a working pattern in a minute or two rather than a dozen round trips.

Capture groups are usually the thing you are testing

Whether the pattern matches at all is the easy part. What you normally need to know is what each set of parentheses pulled out — because that is what your code will go on to use.

Every group's value is listed under each match. If group 2 is empty when you expected a domain name, you have found your bug, and you found it before it reached production.

Which regex dialect this is

It uses your browser's own JavaScript engine. For everyday patterns that behaves exactly as you would expect, and identically to what you will ship if your code is also JavaScript.

If the pattern is destined for PCRE, Python or .NET, be aware that a few advanced constructs differ — lookbehind support, named group syntax and some Unicode property escapes being the usual places. Ordinary patterns of character classes, quantifiers and groups behave the same everywhere.

Questions

Common questions

What does this tool do?

It lets you write a regular expression (a pattern for finding text) and test it against your own text, highlighting every match as you type and breaking down each match and its capture groups. It's for building and debugging patterns before you use them in code or a find-and-replace.

How do I use it?

Type your pattern in the top box (between the / marks), toggle any flags you need on the right, and paste your text below. Matches highlight instantly, and each one is listed with its position and any captured groups.

What do the flags g, i, m, s mean?

g (global) finds all matches instead of just the first. i ignores case. m (multiline) makes ^ and $ match the start and end of each line rather than the whole text. s (dotall) lets the . character match newlines too. Click each flag to turn it on or off.

What are capture groups?

Parentheses ( ) in a pattern capture part of each match separately. For example (\w+)@(\w+) captures the name and domain of an email as group 1 and group 2. The tool lists every group's value under each match, which is the main thing you're usually testing.

My pattern shows an error — what does that mean?

The tool shows the browser's own message when a pattern isn't valid — usually an unbalanced bracket or parenthesis, or a stray special character. The pattern box turns red until it's fixed. Check that every ( [ { has a matching close.

Which flavor of regex is this?

It uses your browser's built-in JavaScript regular-expression engine. That's very close to most common regex flavors, but a few advanced features differ from, say, PCRE or Python. For everyday patterns it behaves exactly as you'd expect.

Is my text private?

Completely. The pattern and your test text are processed entirely in your browser — nothing is uploaded or sent anywhere.

Our own software

Dictate it instead of typing it

Hold a key, say the sentence, and the words land in whatever Windows window you were already in. Runs on your own PC — no account, no upload, nothing to renew.

$79 launch price · $99 regular · buy once
See Lickety
All 45 tools, offline, in one app. A signed Windows install with a Start-menu icon and no browser needed. A few dollars, once. The web versions stay free.
See the offline bundle