RB
Regex Builder & Explainer
🔵 Stable🕐 updated 2026-07-08
✅ 4.5/5
🔷 SkillSpec L3
pm-engineering
Build a regular expression from a plain-English description, or explain an existing one. Use when asked to write a regex, match/validate/extract a pattern, or understand what a regex does. Produces the regex, a token-by-token breakdown, passing and failing test cases, and notes on flavor/edge cases.
What to give it
▸What should match and what should NOT — 3+ positive examples and, critically, 2+ near-miss negatives (the strings that *look* matchable but must be rejected). The negatives are where every regex bug lives.
▸The engine / flavor — (JavaScript, PCRE, Python `re`, RE2, grep -E…) — anchors, lookbehind, and Unicode behaviour differ enough to break portability silently.
▸Where it runs — validation, extraction, or replacement changes how greedy the pattern should be.
✅ The bar it holds itself to
Every skill in this library self-verifies — these are this skill's own quality checks, straight from its definition.
✓The pattern actually passes the listed "matches" and rejects the "rejects"
✓Flavor and flags are stated
✓The breakdown covers every token, not just the interesting ones
✓Edge cases / backtracking risks are flagged
⚠️ What it refuses to do
Do not give a regex with no test cases — always prove it
Do not ignore the flavor — `\d`, lookbehind, and named groups differ across engines
Do not produce an unreadable one-liner when a commented/verbose version or a non-regex approach is clearer
Do not silently assume anchoring — state whether it matches the whole string or a substring
Install
npx pm-claude-skills add --agent claude # or codex · cursor · gemini · hermes
# or one-line MCP (every skill, any client):
claude mcp add pm-skills -- npx -y pm-claude-skills-mcp
Start with
Related skills
🔌 Embed this skill
Drop this on your blog, docs, or site — it renders a "Run this skill" card:
<div data-pm-skill="regex-builder"></div>
<script src="https://mohitagw15856.github.io/pm-claude-skills/embed.js" async></script>
💬 Discussion
Regex Builder & Explainer is one of 599 open-source professional AI agent skills — all SkillSpec L3.
Try them all in the browser · ⭐ Star on GitHub · Browse the full catalog