Search

PythonReactSEOPDF
OpenClaw

regex-patterns

Practical regex patterns across languages and use cases. Use when validating input (email, URL, IP), parsing log lines, extracting data from text, refactoring code with search-and-replace, or debugging why a regex doesn't match.

gitgoodordietrying0 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install gitgoodordietrying/regex-patterns

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Regex Patterns

Practical regular expression cookbook. Patterns for validation, parsing, extraction, and refactoring across JavaScript, Python, Go, and command-line tools.

When to Use

  • Validating user input (email, URL, IP, phone, dates)
  • Parsing log lines or structured text
  • Extracting data from strings (IDs, numbers, tokens)
  • Search-and-replace in code (rename variables, update imports)
  • Filtering lines in files or command output
  • Debugging regexes that don't match as expected

Quick Reference

Metacharacters
Pattern Matches Example
. Any character (except newline) a.c matches abc, a1c
\d Digit [0-9] \d{3} matches 123
\w Word char [a-zA-Z0-9_] \w+ matches hello_123
\s Whitespace [ \t\n\r\f] \s+ matches spaces/tabs
\b Word boundary \bcat\b matches cat not scatter
^ Start of line ^Error matches line starting with Error
$ End of line \.js$ matches line ending with .js
\D, \W, \S Negated: non-digit, non-word, non-space
Quantifiers
Pattern Meaning
* 0 or more (greedy)
+ 1 or more (greedy)
? 0 or 1 (optional)
{3} Exactly 3
{2,5} Between 2 and 5
{3,} 3 or more
*?, +? Lazy (match as few as possible)
Groups and Alternation
Pattern Meaning
(abc) Capture group
(?:abc) Non-capturing group
(?P<name>abc) Named group (Python)
(?<name>abc) Named group (JS/Go)
a|b Alternation (a or b)
[abc] Character class (a, b, or c)
[^abc] Negated class (not a, b, or c)
[a-z] Range
Lookahead and Lookbehind
Pattern Meaning
(?=abc) Positive lookahead (followed by abc)
(?!abc) Negative lookahead (not followed by abc)
(?<=abc) Positive lookbehind (preceded by abc)
(?<!abc) Negative lookbehind (not preceded by abc)

Validat...

Source information

Source
github
Repository
openclaw/skills
Path
skills/gitgoodordietrying/regex-patterns
Version
—
Commit
e6547b5c22819839c969cfbd70837c376a36d08a
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# Regex Patterns

Practical regular expression cookbook. Patterns for validation, parsing, extraction, and refactoring across JavaScript, Python, Go, and command-line tools.

## When to Use

- Validating user input (email, URL, IP, phone, dates)
- Parsing log lines or structured text
- Extracting data from strings (IDs, numbers, tokens)
- Search-and-replace in code (rename variables, update imports)
- Filtering lines in files or command output
- Debugging regexes that don't match as expected

## Quick Reference

### Metacharacters

| Pattern | Matches | Example |
|---|---|---|
| `.` | Any character (except newline) | `a.c` matches `abc`, `a1c` |
| `\d` | Digit `[0-9]` | `\d{3}` matches `123` |
| `\w` | Word char `[a-zA-Z0-9_]` | `\w+` matches `hello_123` |
| `\s` | Whitespace `[ \t\n\r\f]` | `\s+` matches spaces/tabs |
| `\b` | Word boundary | `\bcat\b` matches `cat` not `scatter` |
| `^` | Start of line | `^Error` matches line starting with Error |
| `$` | End of line | `\.js$` matches line ending with .js |
| `\D`, `\W`, `\S` | Negated: non-digit, non-word, non-space | |

### Quantifiers

| Pattern | Meaning |
|---|---|
| `*` | 0 or more (greedy) |
| `+` | 1 or more (greedy) |
| `?` | 0 or 1 (optional) |
| `{3}` | Exactly 3 |
| `{2,5}` | Between 2 and 5 |
| `{3,}` | 3 or more |
| `*?`, `+?` | Lazy (match as few as possible) |

### Groups and Alternation

| Pattern | Meaning |
|---|---|
| `(abc)` | Capture group |
| `(?:abc)` | Non-capturing group |
| `(?P<name>abc)` | Named group (Python) |
| `(?<name>abc)` | Named group (JS/Go) |
| `a\|b` | Alternation (a or b) |
| `[abc]` | Character class (a, b, or c) |
| `[^abc]` | Negated class (not a, b, or c) |
| `[a-z]` | Range |

### Lookahead and Lookbehind

| Pattern | Meaning |
|---|---|
| `(?=abc)` | Positive lookahead (followed by abc) |
| `(?!abc)` | Negative lookahead (not followed by abc) |
| `(?<=abc)` | Positive lookbehind (preceded by abc) |
| `(?<!abc)` | Negative lookbehind (not preceded by abc) |

## Validat...

Related skills

OpenClaw

13-Day Sprint Method

galizki

Productivity system based on Maya calendar with 13 natural tones for project management and personal development

OpenClaw

1password

daggerkun007

Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.