Explain any regex in plain English. No more squinting at
^[a-z0-9._%+-]+@….
$ npx regex-plain "/^[a-z]+$/i"
Pattern: /^[a-z]+$/i
Meaning: Matches a string that, from start to end, contains:
any character in: a–z, repeated one or more times
Flags:
i — case-insensitive
Free tier. Pro tier at $9 → https://buy.stripe.com/dRm9AM8S29ZVcbL4k6d3i07# one-shot, no install
npx regex-plain "/your-regex-here/flags"
# or install globally
npm install -g regex-plain
regex-plain "/your-regex-here/flags"Requires Node.js 18 or newer.
regex-plain "/pattern/flags" # explain a regex
regex-plain "/pattern/" --pro # add match examples + pitfall detection
regex-plain "/pattern/" --json # machine-readable JSON
regex-plain "/pattern/" --no-color # disable ANSI colors
regex-plain --help # full help
regex-plain --version # version--pro— run Pro analysis (match examples, pitfalls, named groups, flag notes)--json— emit JSON (no colors, no upsell); combines free + pro when both flags set--no-color— disable ANSI colors (also viaNO_COLOR=1env var)
Colors are auto-disabled when stdout is not a TTY.
Inputs accepted:
"/pattern/flags"— full regex literal"pattern"— raw pattern, no flags"pattern/flags"— leading slash optional
Always quote the regex so your shell doesn't eat the special characters.
import { explain, formatExplanation } from 'regex-plain';
const result = explain('/^\\d{3}-\\d{4}$/');
console.log(formatExplanation(result));
// → { pattern, flags, opening, meaning: [...], flagsDescribed: [...],
// namedGroups: [...], numberedGroups: [...] }| Feature | Free | Pro ($9) |
|---|---|---|
| Plain-English explanation of the pattern | ✅ | ✅ |
| Flags decoded | ✅ | ✅ |
| Match examples (strings that match/don't) | ✅ | |
| Named capture group documentation | ✅ | |
| Flag interaction warnings | ✅ | |
| Pitfall detection (catastrophic backtracking, etc.) | ✅ |
Get Pro: https://buy.stripe.com/dRm9AM8S29ZVcbL4k6d3i07
Parses the regex with regexp-tree into an AST,
then walks the tree and emits human-readable descriptions for each node. No LLM. No
hallucinated explanations. If a feature is too gnarly to describe cleanly, regex-plain
says so and points you at regex101.com rather than guessing.
git clone https://github.com/builtbyzero/regex-plain.git
cd regex-plain
npm install
npm test # 41 tests, zero dev deps
node src/cli.js "/^[a-z]+$/i"MIT © builtbyzero — https://builtbyzero.com