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.
Why use this skill?
Learn to validate inputs, parse logs, and refactor code faster with the OpenClaw regex-patterns skill. Includes a complete cookbook for JS, Python, and Go.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/gitgoodordietrying/regex-patternsWhat This Skill Does
The regex-patterns skill serves as an extensive, built-in library for regular expression management. Instead of relying on guesswork or generic search engine results, this skill provides vetted, production-ready regex strings for common validation, extraction, and transformation tasks. It covers the syntax differences between engine implementations in Python, JavaScript, and Go, ensuring the pattern provided will work within your specific execution context.
Installation
You can install this skill by running the following command in your terminal: clawhub install openclaw/skills/skills/gitgoodordietrying/regex-patterns
Use Cases
This skill is designed for developers, data analysts, and system administrators who frequently interact with text processing. Common use cases include:
- Input Validation: Ensuring user-submitted emails, phone numbers, and IP addresses meet specific formatting requirements before they hit your database.
- Log Parsing: Quickly extracting timestamps, process IDs, or error codes from unstructured server logs or command-line output.
- Bulk Refactoring: Performing complex search-and-replace operations in large codebases—such as migrating import paths or renaming variables while preserving specific formatting rules.
- Debugging: Identifying why a regex pattern is failing to match intended targets by providing structural analysis of lookaheads, lookbehinds, and greedy vs. lazy quantifiers.
- Data Cleaning: Stripping unwanted whitespace, HTML tags, or sensitive information from scraped or user-provided data.
Example Prompts
- "I need a regex pattern to validate a standard US phone number that works in JavaScript and handles parentheses and dashes. Can you help?"
- "Extract all IPv4 addresses from this text file output and give me the pattern I should use in Python's re module."
- "Why is my regex
.*failing to match the text on the next line, and how can I modify it to be non-greedy or include newlines?"
Tips & Limitations
Regex is incredibly powerful but can become a maintenance burden if patterns are overly complex. When using this skill, always prefer readability; complex regex with multiple nested groups can be difficult for other developers to maintain. If a pattern requires massive amounts of lookaheads or complex logic, consider breaking it into multiple, smaller processing steps. Note that this skill provides patterns for standardized engines; always test against your specific language implementation, as Go's RE2 engine, for instance, does not support lookarounds. Use the provided cookbook for common patterns, but perform unit testing on edge cases like malformed emails or non-standard URL formats to ensure your implementation remains secure.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-gitgoodordietrying-regex-patterns": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Related Skills
shell-scripting
Write robust, portable shell scripts. Use when parsing arguments, handling errors properly, writing POSIX-compatible scripts, managing temp files, running commands in parallel, managing background processes, or adding --help to scripts.
api-dev
Scaffold, test, document, and debug REST and GraphQL APIs. Use when the user needs to create API endpoints, write integration tests, generate OpenAPI specs, test with curl, mock APIs, or troubleshoot HTTP issues.
skill-writer
Write high-quality agent skills (SKILL.md files) for ClawdHub/MoltHub. Use when creating a new skill from scratch, structuring skill content, writing effective frontmatter and descriptions, choosing section patterns, or following best practices for agent-consumable technical documentation.
log-analyzer
Parse, search, and analyze application logs across formats. Use when debugging from log files, setting up structured logging, analyzing error patterns, correlating events across services, parsing stack traces, or monitoring log output in real time.
data-validation
Validate data with schemas across languages and formats. Use when defining JSON Schema, using Zod (TypeScript) or Pydantic (Python), validating API request/response shapes, checking CSV/JSON data integrity, or setting up data contracts between services.