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

@v0idd0/regexlab

v1.0.1

Published

regexlab — explain regex patterns in plain English. Token-by-token breakdown: anchors, character classes, quantifiers, groups, lookarounds, flags. CLI + library. Free forever from vøiddo.

Downloads

247

Readme

regexlab

npm version npm downloads License: MIT Node ≥14

Explain regex patterns in plain english. Read the manual.

$ regexlab '\d{3}-\d{4}'
pattern: \d{3}-\d{4}

\d{3}        → a digit (0–9) exactly 3 times
-            → the literal character "-"
\d{4}        → a digit (0–9) exactly 4 times

Why regexlab

You wrote a regex six months ago. You don't remember what it does. Today's reviewer wants you to explain it. Stack Overflow answers from 2014 paraphrase, regex101 wants your network and your eyes, and the real man re_format(7) is hostile if you only need it twice a year. regexlab is the explainer that lives in your terminal — local, offline-capable, no popovers.

Install

npm install -g @v0idd0/regexlab

Usage

# Explain a bare pattern
regexlab '\d{3}-\d{4}'

# Explain with flags
regexlab '/foo|bar/gi'

# JSON output for piping
regexlab --json '^[a-z]+$' | jq '.tokens'

# Help
regexlab --help

What it handles

  • Anchors: ^, $, \b, \B
  • Character classes: \d, \D, \w, \W, \s, \S, [...], [^...]
  • Quantifiers: *, +, ?, {n}, {n,}, {n,m}
  • Groups: capturing (...), non-capturing (?:...), named (?<name>...)
  • Lookarounds: (?=...), (?!...), (?<=...), (?<!...)
  • Alternation: |
  • Escapes: \., \\, \(, etc.
  • Backreferences: \1 through \9
  • Flags: g, i, m, s, u, y

Compared to alternatives

| tool | offline? | network IO | per-token explanation | regex101-style match testing | |---|---|---|---|---| | regexlab | yes | none | yes | optional via API | | regex101.com | no | tracks input | yes | yes (web) | | regexr.com | no | tracks input | yes | yes (web) | | pcregrep --explain | yes | none | terse | no | | ChatGPT/Claude | depends | sends pattern | conversational | manual |

If you're authoring a long regex and want hover-to-test feedback, regex101 is unbeatable. If you're explaining a regex in your terminal (in a code review, in a hook, on a server you SSHed into), regexlab is the one that fits the workflow.

FAQ

Does it actually run the regex against test strings? Only via the programmatic API (returns matches if you pass a subject string). The CLI is explanation-only because that's the dominant use case.

Is it accurate on PCRE-only features? Most of what JavaScript's RegExp supports is the safe subset. Lookbehinds, named groups, atomic groups — covered. \K and balanced groups (.NET) are explicitly out of scope and the parser will say so.

Why doesn't it suggest a "better" regex? Because "better" depends on whether you're optimizing for readability, backtracking safety, or one of nine character-class alternatives. Static suggestions miss the point — regexlab explains, doesn't editorialize.

Will it choke on a 4KB regex? Try us. The tokenizer is recursive descent and has been fed several embarrassingly large captcha-bypass regexes in testing. The output gets long before the tool gets slow.

Programmatic API

import { explain, format } from '@v0idd0/regexlab';

const result = explain('/^\\d{3}-\\d{4}$/g');
console.log(format(result));

// Or get structured output:
console.log(result.tokens);
// [{ token: '\\d{3}', explanation: '...' }, ...]

More from the studio

This is one tool out of many — see from-the-studio.md for the full lineup of vøiddo products (other CLI tools, browser extensions, the studio's flagship products and games).

License

MIT.


Built by vøiddo — a small studio shipping AI-flavoured products, free dev tools, Chrome extensions and weird browser games.