agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/regex/SKILL.md

regex

Skill2 starsChanged 4 months agoMITView on GitHub

Build, explain, or debug a regular expression from a plain-English description, with worked examples and test cases. Use when the user says "write a regex", "regex for", "explain this regex", "why doesn't this pattern match", "match a pattern like", or pastes a regex and asks what it does.

3 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Clarify the target flavor: if it matters: regex dialects differ (PCRE, JavaScript, Python re, Go RE2, POSIX, grep/ripgrep).

    line 15
  2. Distinctive:

    If the user says it's not working, identify why (missing anchor, wrong flag, escaping, greedy quantifier) and give the corrected version.

    line 25
  3. Very specific:

    Prefer readable, maintainable patterns over clever one-liners.

    line 29
  4. Distinctive:

    Always provide concrete match / no-match examples — never hand over a bare pattern.

    line 30
  5. Distinctive:

    If a regex is the wrong tool (e.g.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Instructions

Handle the regex task in $ARGUMENTS. Two modes — detect which from the request:

Mode A — build a regex from a description

  1. Clarify the target flavor if it matters: regex dialects differ (PCRE, JavaScript, Python re, Go RE2, POSIX, grep/ripgrep). Infer from context (the file type or tool mentioned); if genuinely ambiguous, ask or state the flavor you're assuming.
  2. Write the pattern, then explain it token by token so the user understands and can adjust it.
  3. Show test cases: a table of inputs that should match and inputs that should not, with the expected result. Cover the tricky edges (empty string, boundaries, unicode/accents, greedy vs. lazy).
  4. Give a ready-to-paste snippet in the user's language showing how to use it (with the right flags — i, m, g, etc.).
  5. Warn about footguns you introduced or avoided: catastrophic backtracking, unanchored matches, unescaped metacharacters, . matching newlines.

Mode B — explain or debug an existing regex

  1. Break it into components and explain what each does in plain language.
  2. State exactly what it matches and what it rejects, with examples.
  3. If the user says it's not working, identify why (missing anchor, wrong flag, escaping, greedy quantifier) and give the corrected version.

Rules

  1. Prefer readable, maintainable patterns over clever one-liners. Suggest named groups or verbose/x mode for complex patterns.
  2. Always provide concrete match / no-match examples — never hand over a bare pattern.
  3. Flag any catastrophic-backtracking risk and offer a safer rewrite.
  4. If a regex is the wrong tool (e.g. parsing HTML or deeply nested structures), say so and suggest the proper approach.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.