Download Cheat sheet PDF 12 pages · syntax, editors, patterns, Unicode, performance, debugging

How it works.

Three things happen when you paste a regex into our explainer. All three run in your browser; nothing is sent to a server.

1. We parse your regex into a tree

The parser is a hand-written recursive-descent implementation in plain JavaScript. It tokenizes your regex and builds an abstract syntax tree (AST) — a structured representation where each node is a regex construct (group, alternation, quantifier, character class, etc.) with its own children.

This is the same kind of tree your favorite programming language's compiler builds when you write code. Building one for regex is what lets us explain the structure correctly, even when groups are nested or quantifiers stack.

2. We walk the tree and explain each node

Each AST node knows how to describe itself. A character class says "match any single character from this set." A lookahead says "check that what follows matches, without consuming characters." A quantifier wraps another node and describes how many times that node should repeat.

The output is a tree of descriptions, which is what you see in the explainer panel. Most other regex tools produce a flat list of tokens; we keep the structure because it's the structure that makes the regex understandable.

3. We try to identify the intent

Before showing the tree, we look at the overall shape of your regex and try to recognize common patterns — email, URL, date, IP address, UUID, hex color, etc. When we recognize one, we lead the explanation with what the pattern is trying to match in plain English ("This matches an email address"). When we don't recognize it, we fall back to a structural description.

This intent detection is rule-based, not AI. We maintain a catalog of pattern shapes and check your regex against each. The result is fast, deterministic, and doesn't hallucinate.

What about testing the regex?

When you provide a test string, we run your pattern against it using the browser's built-in JavaScript regex engine. Matches are highlighted inline. Because we use the real engine, you get exactly the behavior you'd see in new RegExp(...) in your own code.

For flavors other than JavaScript (PCRE, Python, etc.), we currently explain the syntax but defer execution to the JavaScript engine. Flavor-accurate execution is on the roadmap.

What runs on a server?

Nothing related to your regex. The site is a static HTML/CSS/JavaScript bundle hosted on a CDN. The only network requests after page load are for Google Analytics (anonymous page views) and the ad networks. Your regex content is never transmitted anywhere.

Where's the source?

The regex engine is small enough that you can read it directly in your browser's developer tools. Open this page, view source, find regex-engine.js. It's ~1,500 lines, no dependencies, MIT-licensed if we ever publish it formally. If you'd find a GitHub mirror useful, let us know — that's reasonable feedback.