npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

explain-regex

v0.3.0

Published

Explain any regex in plain English. Free CLI; Pro adds match examples and pitfall detection.

Readme

regex-plain

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

Install

# 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.

Usage

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

Options

  • --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 via NO_COLOR=1 env 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.

Programmatic API

import { explain, formatExplanation } from 'regex-plain';

const result = explain('/^\\d{3}-\\d{4}$/');
console.log(formatExplanation(result));
// →   { pattern, flags, opening, meaning: [...], flagsDescribed: [...],
//       namedGroups: [...], numberedGroups: [...] }

Free vs Pro

| 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

How it works

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.

Development

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"

License

MIT © builtbyzero — https://builtbyzero.com