pattern-library

Curated collection of production-ready regular expressions covering emails, URLs, dates, identifiers, and more, with copy-paste patterns and test strings

7 stars

Best use case

pattern-library is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Curated collection of production-ready regular expressions covering emails, URLs, dates, identifiers, and more, with copy-paste patterns and test strings

Teams using pattern-library should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pattern-library/SKILL.md --create-dirs "https://raw.githubusercontent.com/heldernoid/agentic-build-templates/main/projects/data-analytics/regex-tester/skills/pattern-library/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pattern-library/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pattern-library Compares

Feature / Agentpattern-libraryStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Curated collection of production-ready regular expressions covering emails, URLs, dates, identifiers, and more, with copy-paste patterns and test strings

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# pattern-library Skill

## When to Use

Use this skill when you need a reliable regular expression for a common validation or extraction task. All patterns are tested against realistic edge cases and include example test strings.

## Email

### Basic Email (permissive)
```
\b[\w.+-]+@[\w-]+\.[\w.-]+\b
```
Matches most real-world email addresses. Does not enforce RFC 5322 strictly. Good for extraction.

Test: `alice@example.com bob.smith+tag@co.uk noreply@system.app`

### Strict email (no IP literals, standard TLD)
```
^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}$
```
Good for form validation. Flags: none (anchored, single address).

## URL

### HTTP/HTTPS URL
```
https?://[^\s/$.?#].[^\s]*
```
Flags: `gi`

Test: `Visit https://example.com/path?q=1 or http://sub.domain.org`

### URL with protocol, host, path, query (with groups)
```
(https?):\/\/([\w.-]+)(\/[^\s?#]*)?(\\?[^\s#]*)?(#\S*)?
```
Groups: 1=protocol, 2=host, 3=path, 4=query, 5=fragment

## Date and Time

### ISO 8601 Date (YYYY-MM-DD)
```
\b(\d{4})-(\d{2})-(\d{2})\b
```
Groups: 1=year, 2=month, 3=day. Flags: `g`

### US Date (MM/DD/YYYY)
```
\b(0?[1-9]|1[0-2])\/(0?[1-9]|[12]\d|3[01])\/(\d{4})\b
```
Groups: 1=month, 2=day, 3=year

### 24-hour time (HH:MM or HH:MM:SS)
```
\b([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?\b
```

### ISO 8601 datetime
```
\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})
```

## Numbers

### Integer (positive or negative)
```
-?\b\d+\b
```

### Decimal number
```
-?\b\d+(?:\.\d+)?\b
```

### Currency (USD style)
```
\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?
```
Test: `$1,200.00 $99 $1,000,000.50`

### Hex number
```
\b0x[0-9a-fA-F]+\b
```

## Identifiers

### UUID v4
```
\b[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\b
```
Flags: `gi`

### Hex color (3 or 6 digit)
```
#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b
```

### IPv4 address
```
\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b
```

### MAC address
```
\b(?:[0-9a-fA-F]{2}[:\-]){5}[0-9a-fA-F]{2}\b
```
Flags: `gi`

### Semantic version
```
\bv?(\d+)\.(\d+)\.(\d+)(?:-[\w.]+)?(?:\+[\w.]+)?\b
```
Groups: 1=major, 2=minor, 3=patch. Flags: `g`

Test: `v1.2.3 2.0.0-beta.1 3.1.4+build.20240101`

## Text and Content

### Capitalized proper name (First Last)
```
^[A-Z][a-z]+(?:\s[A-Z][a-z]+)+$
```
Flags: `m` for multi-line input

### URL slug
```
^[a-z0-9]+(?:-[a-z0-9]+)*$
```

### Non-empty, non-whitespace string
```
^\S[\s\S]*\S$|^\S$
```

### Repeated word (typo detector)
```
\b(\w+)\s+\1\b
```
Flags: `gi`
Test: `the the quick brown fox fox jumps`

## Code and Development

### HTML tag (opening)
```
<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>
```
Group 1 = tag name

### CSS hex color in stylesheet
```
(?<=#)[0-9a-fA-F]{3,8}\b
```
Lookbehind requires `#` but excludes it from the match.

### JavaScript variable name
```
\b[a-zA-Z_$][a-zA-Z0-9_$]*\b
```

### Markdown heading
```
^(#{1,6})\s+(.+)$
```
Flags: `gm`. Group 1 = `#` characters, group 2 = title text.

### Docker image reference
```
^(?:([a-z0-9.-]+(?::[0-9]+)?)\/)?((?:[a-z0-9._-]+\/)*[a-z0-9._-]+)(?::([a-zA-Z0-9._-]+))?(?:@(sha256:[a-f0-9]{64}))?$
```
Groups: 1=registry, 2=repository, 3=tag, 4=digest

### Semantic commit message
```
^(feat|fix|docs|style|refactor|perf|test|chore|revert)(?:\([\w-]+\))?: .+
```
Flags: `m`

## Network and Security

### IPv6 address (simplified)
```
\b(?:[0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}\b
```

### Email header X-Forwarded-For extraction
```
(?:^|,\s*)(\d{1,3}(?:\.\d{1,3}){3})
```

### JWT token structure
```
^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$
```

### Base64 string
```
^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$
```

## Pattern Notes

All patterns in the library use JavaScript `RegExp` compatible syntax. Features that require the `v` flag (Unicode Sets) are not included in the base library since browser support is not universal.

Patterns marked as "anchored" (`^...$`) are designed for full-string validation and should not use the `g` flag with `String.prototype.test()` across multiple calls -- use `new RegExp(..., flags)` each time or be aware of `.lastIndex` behavior with the `g` flag on `test()`.

Related Skills

regex-patterns

7
from heldernoid/agentic-build-templates

Implement and test regex patterns for detecting secrets in source code.

rename-patterns

7
from heldernoid/agentic-build-templates

Build rename patterns using batch-renamer's pattern variable syntax for bulk file renaming. Use when constructing or understanding rename pattern strings, combining variables like {name}, {ext}, {index:N}, {date}. Triggers include "rename pattern", "pattern variables", "{name} {ext}", "rename syntax", "file naming pattern".

prompt-library

7
from heldernoid/agentic-build-templates

No description provided.

Skill: Uptime Monitoring

7
from heldernoid/agentic-build-templates

## Overview

Skill: Status Page

7
from heldernoid/agentic-build-templates

## Overview

Skill: unit-conversion

7
from heldernoid/agentic-build-templates

## Overview

Skill: recipe-scaler

7
from heldernoid/agentic-build-templates

## Overview

reading-list

7
from heldernoid/agentic-build-templates

Operate the reading-list API to save, manage, tag, search, and export articles.

email-digest

7
from heldernoid/agentic-build-templates

Configure, test, and troubleshoot the reading-list daily email digest delivered via nodemailer.

websocket-realtime

7
from heldernoid/agentic-build-templates

Use the WebSocket connection in poll-builder to receive live vote updates. Use when you need to stream real-time poll results, monitor a poll for new votes, or build a live dashboard. Triggers include "live results", "real-time updates", "stream votes", "watch poll", or "WebSocket".

poll-builder

7
from heldernoid/agentic-build-templates

Self-hosted poll creation tool with real-time results. Use when you need to create a poll, check vote counts, close a poll, export results, or get the shareable link for a poll. Triggers include "create poll", "vote", "poll results", "survey", "collect votes", "share poll", or any task involving polling or voting.

Skill: personal-finance

7
from heldernoid/agentic-build-templates

## Overview