Agent skill

Regex Builder

by Mathews-Tom in Mathews-Tom/armory

DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy.

MITAuto-check passed

Install Regex Builder

skills CLI
$ npx skills add Mathews-Tom/armory --skill regex-builder -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mathews-Tom/armory regex-builder --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/regex-builder .claude/skills/regex-builder && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
regex-builder
GitHub stars
328
Token cost
~2k tokens
SKILL.md length
473 words
Files
6 (incl. references)
Skills in repo
80
Repo updated
First seen
Licence
MIT

At a glance

DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy.

  • Works in 5 steps: Collect Examples → Infer Pattern → Explain Pattern → …
  • SKILL.md covers Reference Files, Prerequisites, Workflow and Output Format
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Regex Builder is an agent skill from Mathews-Tom/armory. DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy. This skill no longer provides meaningful uplift. Retained for reference only.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `evals/cases.yaml`, `references/character-classes.md` and `references/common-patterns.md`).

It works with Python and JavaScript. The repository describes itself as: Curated, production-grade skills for AI coding agents. Battle-tested workflows for developers who use AI seriously. The licence is MIT.

Example prompts

  • “/regex-builder”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Collect Examples
  2. Infer Pattern
  3. Explain Pattern
  4. Generate Edge Cases
  5. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4594fb7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Regex Builder loads about 2k tokens when it runs, and up to ~7k if it reads all its reference files. Until then it costs about 48 tokens; SKILL.md has 473 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~48
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Mathews-Tom/armory at commit 4594fb7, republished under its MIT licence (© Mathews-Tom). 473 words, ~1,961 tokens.

Download SKILL.mdSave it as .claude/skills/regex-builder/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
regex-builder
description
DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy. This skill no longer provides meaningful uplift. Retained for reference only.
metadata.version
1.1.1
metadata.status
deprecated
metadata.category
development
metadata.tags
regex, pattern-matching, testing, validation
metadata.difficulty
beginner

DEPRECATED — Modern Claude models produce accurate, well-explained regex patterns with edge-case test suites natively, including multi-language usage examples. The uplift delta from this skill approaches zero. Retained for archival reference only.

Regex Builder

Transforms matching requirements (positive and negative examples) into tested regex patterns with component-by-component explanations, capture group documentation, edge case identification, and ready-to-use code in Python and JavaScript.

Reference Files

FileContentsLoad When
references/character-classes.mdCharacter class reference, Unicode categories, POSIX classesAlways
references/quantifiers.mdQuantifier behavior, greedy vs lazy vs possessive, backtrackingPattern needs repetition
references/common-patterns.mdValidated patterns for email, URL, phone, IP, date, UUID, etc.Common validation requested
references/flavor-differences.mdSyntax differences between Python, JavaScript, PCRE, POSIXMulti-language usage needed

Prerequisites

  • Clear specification: what should match and what should not
  • Target regex flavor (Python re, JavaScript, PCRE) — defaults to Python

Workflow

Phase 1: Collect Examples

Gather positive (should match) and negative (should not match) examples:

  1. From user — Explicit examples provided
  2. From context — If the user says "match email addresses," infer standard positive and negative examples
  3. From data — If sample data is provided, identify the pattern within it

Minimum: 3 positive examples and 3 negative examples. Fewer examples risk overfitting the pattern to specific cases.

Phase 2: Infer Pattern

Analyze the examples to build a pattern:

  1. Identify fixed literals — Characters that appear in the same position across all positive examples
  2. Identify character classes — Positions where different characters appear but follow a pattern (digits, letters, alphanumeric)
  3. Identify repetition — Elements that appear a variable number of times
  4. Identify optional elements — Parts present in some positive examples but not others
  5. Identify anchoring — Must the pattern match the entire string or can it be a substring?
Show full SKILL.md (192 more words)Show less
Phase 3: Explain Pattern

Break down the pattern into a component table:

ComponentMeaning
^Start of string
[A-Za-z]One letter (upper or lower)
\d{3,5}3 to 5 digits
$End of string

Document capture groups separately if the pattern uses them.

Phase 4: Generate Edge Cases

For every pattern, identify inputs that are likely to cause problems:

  1. Empty string — Does the pattern handle it correctly?
  2. Almost-matching strings — One character off from a valid match
  3. Boundary lengths — Minimum and maximum valid lengths
  4. Special characters — Dots, brackets, backslashes in the input
  5. Unicode — Multi-byte characters, emoji, diacritics
  6. Catastrophic backtracking — Inputs that cause exponential matching time
Phase 5: Output

Produce the pattern, explanation, test cases, and usage examples.

Output Format

## Regex Pattern: {Brief Description}

### Requirements
- **Must match:** {description of valid inputs}
- **Must reject:** {description of invalid inputs}
- **Flavor:** {Python re | JavaScript | PCRE}

### Pattern
```regex
{pattern}
Explanation
ComponentMeaning
{component}{what it matches and why}
Capture Groups
GroupNameCapturesExample
1{name}{what}{example value}
Test Cases
#InputShould MatchReason
1{input}Yes{why — happy path}
2{input}Yes{why — boundary}
3{input}No{why — invalid}
4{input}No{why — near-miss}
5`` (empty)NoEmpty input
Edge Cases
  • {Edge case 1}: {what to watch for}
  • {Edge case 2}: {what to watch for}
Usage

Python:

python
import re

pattern = re.compile(r'{pattern}')

# Match entire string
if pattern.fullmatch(text):
    ...

# Search within string
match = pattern.search(text)
if match:
    captured = match.group(1)

# Find all matches
matches = pattern.findall(text)

JavaScript:

javascript
const pattern = /{pattern}/;

// Test
if (pattern.test(text)) { ... }

// Match
const match = text.match(pattern);
if (match) {
    const captured = match[1];
}

// Find all
const matches = [...text.matchAll(/{pattern}/g)];
text

## Calibration Rules

1. **Correctness over cleverness.** A readable, slightly longer pattern is better than
   a cryptic short one. `[A-Za-z0-9]` is clearer than `\w` when you specifically mean
   alphanumeric without underscores.
2. **Test negatives as rigorously as positives.** A pattern that matches everything
   technically matches all positive examples. Negative examples prevent over-matching.
3. **Anchor when appropriate.** `^\d{3}$` matches exactly 3 digits. `\d{3}` matches
   3 digits anywhere in the string. State the anchoring intent explicitly.
4. **Avoid catastrophic backtracking.** Nested quantifiers like `(a+)+` cause exponential
   time on non-matching input. Test with adversarial inputs.
5. **Named groups over numbered groups.** `(?P<year>\d{4})` (Python) or `(?<year>\d{4})`
   (JS) is self-documenting. Use numbered groups only for simple patterns.
6. **Specify the flavor.** Python `re`, JavaScript, and PCRE have different feature sets.
   Lookaheads, lookbehinds, and Unicode support vary.

## Error Handling

| Problem | Resolution |
|---------|------------|
| Insufficient examples | Ask for more. Minimum 3 positive, 3 negative. |
| Contradictory examples | Flag the contradiction. Ask which examples are correct. |
| Requirements too complex for regex | Suggest a parser instead. Regex cannot handle recursive structures (nested brackets, HTML). |
| Pattern causes backtracking | Rewrite with atomic groups or possessive quantifiers. Test with worst-case input. |
| Unicode requirements unclear | Ask if the pattern needs to handle non-ASCII. Default to ASCII unless specified. |
| Multiple valid patterns | Present the simplest one. Mention alternatives if they have meaningful tradeoffs (performance vs readability). |

## When NOT to Build Regex

Push back if:
- The input requires parsing a recursive grammar (HTML, JSON, nested expressions) — use a parser
- The validation is for a standard format with a library (email validation, URL parsing) — use the standard library
- The pattern is for security-critical input validation as the sole defense — regex is a first filter, not a security boundary
- The user wants to modify matched content in complex ways — regex replacement has limits; suggest code instead

© Mathews-Tom, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/regex-builder of Mathews-Tom/armory.

  • SKILL.md
  • evals/cases.yaml
  • references/character-classes.md
  • references/common-patterns.md
  • references/flavor-differences.md
  • references/quantifiers.md

Open the folder on GitHubat commit 4594fb7

Compare with similar skills

Regex Builder next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Regex Builder compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Regex Builder this skillMathews-Tom/armory328—~2kAutomated safety check: PassMIT
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT
CCXT Crypto Exchange Library2025Emma/vibe-coding-cn23k2 repos~4.4kAutomated safety check: PassMIT
Fory Releaseapache/fory4.6k—~2.9kAutomated safety check: PassApache-2.0
Gemini API Devgoogle-gemini/gemini-skills4.3k—~5.1kAutomated safety check: PassApache-2.0
jscpd Code Migration Trackerkucherenko/jscpd6.4k—~5kAutomated safety check: PassMIT

Similar skills

  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • CCXT Crypto Exchange Library

    2025Emma/vibe-coding-cn

    Reference help for the CCXT library covering crypto exchange APIs, market data, trading and order management across 150+ exchanges in JavaScript, Python and PHP.

    23k GitHub starsUsed in 2 repos~4.4k tokens
    Business, Finance & HRAuto-check passed
  • Fory Release

    apache/fory

    Prepare an Apache Fory release candidate from a clean release branch, including the version bump, RC tag, JVM staging, ASF source artifacts, SVN upload, and vote email.

    4.6k GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Gemini API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when writing code that calls the Gemini API for text generation, multi-turn chat, multimodal understanding, image generation, video generation, speech generation (TTS), voice…

    4.3k GitHub stars~5.1k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Measures a code port between languages or frameworks with jscpd's function-level comparison, porting tests before code and tracking what is left unmatched.

    6.4k GitHub stars~5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 2 days ago
    Backend & APIsAuto-check passed

More from Mathews-Tom/armory

All 80 skills in this repo
  • Architecture Reviewer

    Mathews-Tom/armory

    Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports.

    328 GitHub stars~4.6k tokensUpdated 2 days ago
    Auto-check passed
  • Concept To Image

    Mathews-Tom/armory

    Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG.

    328 GitHub stars~2.6k tokensUpdated 2 days ago
    Auto-check passed
  • Watch

    Mathews-Tom/armory

    A skill your agent uses when analyzing an existing video URL or local recording: "watch this video", "analyze youtube video", "summarize this video", "youtube transcript", "find this moment", "what…

    328 GitHub stars~2.8k tokensUpdated 2 days ago
    Auto-check passed
  • Code Refiner

    Mathews-Tom/armory

    Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.

    328 GitHub stars~3.1k tokensUpdated 2 days ago
    Auto-check passed
  • Concept To Video

    Mathews-Tom/armory

    Turn concepts into animated explainer videos using Manim (Python) with MP4/GIF output, audio overlay, multi-scene composition.

    328 GitHub stars~4.9k tokensUpdated 2 days ago
    Auto-check passed
  • Decision Map

    Mathews-Tom/armory

    Maps the unresolved architecture, policy, and scope decisions that must be answered before planning can start: one durable decision ticket per question on the issue tracker, typed and blocker-linked…

    328 GitHub stars~2.7k tokensUpdated 2 days ago
    Auto-check passed

Questions about Regex Builder

What does Regex Builder do?

DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy. Regex Builder is an agent skill from Mathews-Tom/armory. DEPRECATED: The base model generates, explains, and tests regex patterns natively with high accuracy.

How do I install Regex Builder in Claude Code?

Run `npx skills add Mathews-Tom/armory --skill regex-builder -a claude-code`. Or copy the skill folder (skills/regex-builder in Mathews-Tom/armory) into .claude/skills/regex-builder in your project. Claude Code loads it when a task matches its description.

How do I install Regex Builder in Codex?

Run `npx skills add Mathews-Tom/armory --skill regex-builder -a codex`. Or copy the skill folder (skills/regex-builder in Mathews-Tom/armory) into .agents/skills/regex-builder in your project. Codex loads it when a task matches its description.

Can I use Regex Builder in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mathews-Tom/armory --skill regex-builder -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/regex-builder, .gemini/skills/regex-builder, .github/skills/regex-builder and .opencode/skills/regex-builder in your project.

What does Regex Builder need to run?

SKILL.md names no scripts, command-line tools or credentials: Regex Builder is instructions for the agent only. Our summary lists: Python 3.

Does Regex Builder access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Regex Builder safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Regex Builder use?

Regex Builder is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Regex Builder use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5k tokens, read only when the agent opens those files.

What are the alternatives to Regex Builder?

Skills that share tags, products or a category with Regex Builder: Code Review Checklist (shareAI-lab/learn-claude-code, 78k stars), CCXT Crypto Exchange Library (2025Emma/vibe-coding-cn, 23k stars), Fory Release (apache/fory, 4.6k stars) and Gemini API Dev (google-gemini/gemini-skills, 4.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Regex Builder?

Mathews-Tom (a GitHub user) maintains it in Mathews-Tom/armory, which has 328 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on October 6, 2026.

Source: Mathews-Tom/armory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.