regex-builder
Skill0 starsChanged 7 months agoMITView on GitHub
Builds, debugs, and explains regular expressions for any flavor (PCRE, JavaScript, Python, Go RE2, POSIX). Provides test cases that cover matches, non-matches, and edge cases. Use this skill when the user asks for a regex, says "what's the pattern for X", needs to validate/parse/extract text, or asks to debug or explain an existing regex.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- mergisi/awesome-openclaw-agentstheir own version, first seen Nov 1, 2026
- poorvith-mp/skills-developertheir own version, first seen Aug 19, 2026
- 0xelitesystem/claude-skills-collectiontheir own version, first seen Jun 11, 2026
- ATOM00blue/agent-skills-protheir own version, first seen May 22, 2026
- jMerta/codex-skillstheir own version, first seen Dec 14, 2025
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- mergisi/awesome-openclaw-agents★ 4.1ksame name
- jMerta/codex-skills★ 130same name
- 0xelitesystem/claude-skills-collection★ 0same name
- ATOM00blue/agent-skills-pro★ 0same name
- poorvith-mp/skills-developer★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- api-designerSkill
- bug-report-formatterSkill
- changelog-writerSkill
- code-reviewerSkill
- commit-message-writerSkill
- dependency-upgraderSkill
- dockerfile-doctorSkill
- env-var-auditorSkill
- error-message-improverSkill
- migration-plannerSkill
- pr-description-writerSkill
- readme-generatorSkill
- sql-query-expertSkill
- test-generatorSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Clarify the flavor: Ask if unspecified; default to PCRE / JavaScript (similar enough for most cases).
- Distinctive: line 54
If the user asks for one of these, use the well-tested standard rather than re-deriving:
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Regex Builder
You write correct, readable regex with test coverage.
Process
- Clarify the flavor. Ask if unspecified; default to PCRE / JavaScript (similar enough for most cases).
- Clarify the goal. Match-only, extract groups, validate-and-reject, search-and-replace?
- Get sample inputs — at least 2 should-match and 2 should-not-match examples. Ask if the user didn't provide them.
- Write the regex with anchors as appropriate.
- Show it commented (
/xmode style or inline comments) for non-trivial patterns. - Provide test cases — a small table showing input → match (and captured groups).
Output template
Pattern (JavaScript flavor):
/^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$/i
Explanation:
- ^ start of string
- [a-z0-9._%+-]+ local part: letters, digits, dot, common symbols
- @ literal @
- [a-z0-9.-]+ domain: letters, digits, dot, hyphen
- \.[a-z]{2,} TLD: dot + 2+ letters
- $ end of string
- i flag case-insensitive
Tests:
✓ alice@example.com
✓ bob.smith+filter@sub.example.co
✗ no-at-symbol.com
✗ trailing@dot.
✗ @missing-local.comRules
- Anchor when validating (
^...$); don't anchor when searching/extracting. - Prefer character classes over alternation (
[abc]nota|b|c). - Escape literals — dots, parens, brackets, backslashes — even when "probably safe".
- Use non-capturing groups
(?:...)when you don't need the capture. - Warn about catastrophic backtracking — flag patterns with nested quantifiers like
(a+)+. - Flavor differences matter: lookbehind isn't in older JS engines or Go RE2; named groups syntax varies; Unicode handling varies. Call this out when the user's target flavor lacks a feature.
- Don't use regex to parse HTML, JSON, or other recursive grammars. Recommend a real parser.
Common patterns to recognize
If the user asks for one of these, use the well-tested standard rather than re-deriving:
- Email — RFC 5322 is impractical; use the pragmatic pattern above and validate by sending mail.
- URL — use
URLconstructor in JS /urllib.parsein Python instead of regex. - UUID v4 —
^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i - IPv4 — recommend
ipaddressmodule / library over regex for correctness.
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
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.

