返回顶部
r

regex-toolkit

Test, match, extract, replace, explain, and validate regular expressions from the command line. Includes a library of 25+ common patterns (email, URL, IP, phone, date, UUID, etc.) that can be used by name. Use when the user needs to build, debug, or test regex patterns, extract data with regex, do search-and-replace with backreferences, or understand what a regex does. Zero external dependencies.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
116
下载量
0
收藏
概述
安装方式
版本历史

regex-toolkit

# Regex Toolkit Test, find, replace, explain, and validate regular expressions. Includes 25+ common named patterns. Pure Python, no dependencies. ## Quick Start ```bash # Test a pattern python3 scripts/regex_toolkit.py test '\d+' --text 'abc 123 def' # Use a named pattern (email, url, ipv4, phone-us, uuid, etc.) python3 scripts/regex_toolkit.py findall email --text 'Contact hello@example.com or support@test.org' # Find all matches with positions python3 scripts/regex_toolkit.py findall '\b\w{5}\b' --file input.txt # Search and replace python3 scripts/regex_toolkit.py replace '\bfoo\b' -r bar --text 'foo bar foo' # Explain a regex in plain English python3 scripts/regex_toolkit.py explain '(?P<year>\d{4})-(\d{2})-(\d{2})' # Validate regex syntax python3 scripts/regex_toolkit.py validate '[a-z' # List all common patterns python3 scripts/regex_toolkit.py patterns --list # Pipe from stdin echo "Call 555-1234 or 555-5678" | python3 scripts/regex_toolkit.py findall phone-us ``` ## Commands | Command | Description | |---------|-------------| | `test` | Check if pattern matches. Shows first match position and groups. | | `findall` | Find all matches with positions and captured groups. `--json` for JSON output. | | `replace` | Regex search-and-replace. Supports `\1` backreferences. `--count N` limits replacements. | | `explain` | Break down a regex into plain-English explanation of each element. | | `validate` | Check if a regex pattern is syntactically valid. | | `patterns` | List built-in common patterns or show a specific one by name. | ## Input Options All matching commands accept: `--text 'string'`, `--file path`, or piped stdin. ## Flags | Flag | Description | |------|-------------| | `-i, --ignorecase` | Case-insensitive matching | | `-m, --multiline` | `^`/`$` match line boundaries | | `-s, --dotall` | `.` matches newline | ## Built-in Patterns Use by name instead of writing regex: `email`, `url`, `ipv4`, `ipv6`, `phone-us`, `phone-intl`, `date-iso`, `date-us`, `time-24h`, `hex-color`, `mac-address`, `uuid`, `ssn`, `zip-us`, `credit-card`, `slug`, `semver`, `domain`, `hashtag`, `mention`, `markdown-link`, `html-tag`, `json-key`, `filepath-unix`, `filepath-win`.

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 regex-toolkit-1776096729 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 regex-toolkit-1776096729 技能

通过命令行安装

skillhub install regex-toolkit-1776096729

下载 Zip 包

⬇ 下载 regex-toolkit v1.0.0

文件大小: 5.75 KB | 发布时间: 2026-4-14 12:17

v1.0.0 最新 2026-4-14 12:17
Initial public release of regex-toolkit.

- Test, match, extract, replace, explain, and validate regex patterns from the command line.
- Includes 25+ built-in, named common regex patterns (such as email, URL, IP, phone numbers, dates, UUID, etc.).
- Offers commands for matching (`test`, `findall`), replacing (`replace`), explaining patterns (`explain`), validating regex syntax (`validate`), and listing/viewing patterns (`patterns`).
- Supports input via string, file, or stdin; various matching flags available.
- Pure Python implementation with zero external dependencies.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部