regex

A guide for writing and testing regular expressions, which are patterns used to find, validate, or extract text. It covers matching details such as character groups, repetition, boundaries, and captured parts.

In plain words
What is it for?
Use it to validate formats such as emails, URLs, dates, phone numbers, and IP addresses, or to extract structured text across programming languages.
Why use it?
It helps avoid patterns that match too much, too little, or the wrong text. Testing the expression makes its behavior clearer before it is used in an application.

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/bug-ops/zeph/regex
Any agent
npx skills add bug-ops/zeph --skill regex
Clone the repo
git clone --depth 1 https://github.com/bug-ops/zeph

Made for: Claude Code, Codex.

Per session 85 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,501 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.00085 $0.03501
Opus 5 $0.00043 $0.01750
Sonnet 5 $0.00017 $0.00700
Haiku 4.5 $0.00009 $0.00350

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

Security

Grade A, and why

regex 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 2d 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.

.zeph/skills/regex/SKILL.md · 382 lines

How it starts

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

Regular Expressions Reference

Quick Reference

Pattern Matches
. Any character (except newline)
\d Digit [0-9]
\w Word character [a-zA-Z0-9_]
\s Whitespace (space, tab, newline)
\D, \W, \S Negated versions
^ Start of line
$ End of line
\b Word boundary
* 0 or more
+ 1 or more
? 0 or 1 (optional)
{n} Exactly n
{n,m} Between n and m
[abc] Character class
[^abc] Negated character class
(...) Capture group
(?:...) Non-capturing group
a|b Alternation

Character Classes

Shorthand Classes

Class Equivalent Matches
\d [0-9] Digit
\D [^0-9] Non-digit
\w [a-zA-Z0-9_] Word character
\W [^a-zA-Z0-9_] Non-word character
\s [ \t\n\r\f\v] Whitespace
\S [^ \t\n\r\f\v] Non-whitespace
\h [ \t] Horizontal whitespace (PCRE)
\v [\n\r\f\v] Vertical whitespace (PCRE)

POSIX Classes (use inside [...])

Class Matches
[:alpha:] Letters
[:digit:] Digits
[:alnum:] Letters and digits
[:upper:] Uppercase letters
[:lower:] Lowercase letters
[:space:] Whitespace
[:punct:] Punctuation
[:print:] Printable characters
[:graph:] Visible characters (no space)
[:xdigit:] Hex digits [0-9a-fA-F]

Usage: [[:alpha:]] (double brackets when inside a character class).

Custom Character Classes

[aeiou]          # Vowels
[a-z]            # Lowercase letters
[A-Z]            # Uppercase letters
[0-9]            # Digits
[a-zA-Z0-9]     # Alphanumeric
[^aeiou]         # NOT vowels
[a-z&&[^m-r]]   # a-z except m-r (intersection, Java/Rust)
[-.]             # Literal hyphen and dot (hyphen first or last)
[\\^]            # Literal backslash and caret

Quantifiers

Greedy (match as much as possible)

Read the full file on GitHub · 382 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. 2d ago First seen · 382 lines · 85 tokens per session scan A 291c2584687c

Subscribe to this mod's changes

regex is a skill published in the GitHub repository bug-ops/zeph (57 stars, last pushed 8d ago), licensed MIT. It adds 85 tokens to every session and 3,501 once invoked, about $0.0004 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-30.