regex-decoder

regex-decoder is a skill for Claude Code, Codex from surfmind-space/awesome-surfmind. It costs 65 tokens per session (689 once invoked), scanned A, original, MIT.

A tool that explains a regular expression—a text-matching pattern—in plain language, piece by piece. It also shows examples of text the pattern accepts and rejects, taking its flags and visible regex flavor into account.

In plain words
What is it for?
Use it to decode, check, or understand a regex used in JavaScript, Python, PCRE, RE2, Rust, POSIX, or another stated or inferred regex engine.
Why use it?
It helps you understand an unfamiliar pattern without guessing what each symbol means or overlooking edge cases such as anchoring, escaping, or overly broad matching.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/surfmind-space/awesome-surfmind/regex-decoder
Any agent
npx skills add surfmind-space/awesome-surfmind --skill regex-decoder
Clone the repo
git clone --depth 1 https://github.com/surfmind-space/awesome-surfmind

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for regex-decoder

README.md
[![agentmods](https://agentmods.dev/badge/skills/surfmind-space/awesome-surfmind/regex-decoder.svg)](https://agentmods.dev/skills/surfmind-space/awesome-surfmind/regex-decoder)
Your own site
<a href="https://agentmods.dev/skills/surfmind-space/awesome-surfmind/regex-decoder"><img src="https://agentmods.dev/badge/skills/surfmind-space/awesome-surfmind/regex-decoder.svg" alt="Measured on agentmods" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 689 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.00689
Opus 5 $0.00032 $0.00345
Sonnet 5 $0.00013 $0.00138
Haiku 4.5 $0.00006 $0.00069

Measured 5d ago against content hash e0990bf881f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

regex-decoder scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/regex-decoder/SKILL.md · 43 lines

How it starts

The opening of the file, as written. The whole thing — 43 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Regex Decoder

Break a regular expression down into plain-language parts so the user understands exactly what it accepts and rejects. Work only from the pattern and flags given; don't assume a feature works in every engine, and don't rewrite the pattern without preserving its behavior.

  1. Identify the regex flavor if visible (JavaScript, Python, PCRE, RE2, Rust, POSIX) and any flags, since they change meaning.
  2. Break the pattern into ordered pieces — each anchor, character class, quantifier, group, and literal as its own piece — and explain each in plain language.
  3. Give a couple of strings it matches and a couple it rejects, including a near-miss that shows where the boundary is.
  4. Call out edge cases that bite people: anchoring, greediness, escaping, capture vs. non-capture groups, Unicode behavior, and catastrophic-backtracking risk when relevant.

Return concise headings and include these sections when they fit: Plain-English summary, Piece by piece, Matches / Rejects, Edge cases, Safer rewrite (only if it preserves behavior). If the pattern is ambiguous or the flavor is unknown, say so and explain the most common interpretation. Respond in the same language as the user's request.

Example

Pattern (JavaScript): ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$

Plain-English summary: A loose email check — local part, then @, then a domain ending in a dot and at least two letters.

Piece by piece:

  • ^ — anchors to the start of the string.
  • [a-zA-Z0-9._%+-]+ — one or more letters, digits, or . _ % + - (the local part).
  • @ — a literal at-sign.
  • [a-zA-Z0-9.-]+ — one or more letters, digits, dots, or hyphens (the domain).
  • \. — a literal dot (escaped, so not "any character").
  • [a-zA-Z]{2,} — two or more letters (the TLD).
  • $ — anchors to the end of the string.

Matches: [email protected], [email protected]

Rejects: [email protected] (TLD too short), no-at-sign.com (no @), [email protected] (leading space — anchors forbid it).

Edge cases: Anchors mean the whole string must match, so surrounding whitespace fails. It accepts plenty of invalid addresses ([email protected], consecutive dots) — fine for a form hint, not for true validation.

Read the full file on GitHub · 43 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 43 lines · 65 tokens per session scan A e0990bf881f9

Subscribe to this mod's changes

regex-decoder is a skill published in the GitHub repository surfmind-space/awesome-surfmind (5 stars, last pushed 1mo ago), licensed MIT. It adds 65 tokens to every session and 689 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.