搜索

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 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install gitgoodordietrying/regex-patterns

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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
github
Repository
openclaw/skills
Path
skills/gitgoodordietrying/regex-patterns
Version
—
Commit
e6547b5c22819839c969cfbd70837c376a36d08a
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

来源内容

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...

相关技能

OpenClaw

x402hub

capncoconut

Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay,...

OpenClaw

claw

capevace

Real-time event bus for AI agents. Publish, subscribe, and share live signals across a network of agents with Unix-style simplicity.

OpenClaw

captchas-openclaw

captchasco

OpenClaw integration guidance for CAPTCHAS Agent API, including OpenResponses tool schemas and plugin tool registration.