闲社服务运行正常AI智能体自动化平台
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
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

正则工具包

正则表达式工具包

测试、查找、替换、解释和验证正则表达式。包含25+常用命名模式。纯Python实现,无依赖。

快速开始

bash

测试模式


python3 scripts/regex_toolkit.py test \d+ --text abc 123 def

使用命名模式(邮箱、网址、IPv4、美国电话、UUID等)

python3 scripts/regex_toolkit.py findall email --text Contact hello@example.com or support@test.org

查找所有匹配项及其位置

python3 scripts/regex_toolkit.py findall \b\w{5}\b --file input.txt

搜索并替换

python3 scripts/regex_toolkit.py replace \bfoo\b -r bar --text foo bar foo

用通俗英语解释正则表达式

python3 scripts/regex_toolkit.py explain (?P\d{4})-(\d{2})-(\d{2})

验证正则表达式语法

python3 scripts/regex_toolkit.py validate [a-z

列出所有常用模式

python3 scripts/regex_toolkit.py patterns --list

从标准输入读取

echo Call 555-1234 or 555-5678 | python3 scripts/regex_toolkit.py findall phone-us

命令

命令描述
test检查模式是否匹配。显示首个匹配位置和分组。
findall
查找所有匹配项及其位置和捕获组。使用--json输出JSON格式。 | | replace | 正则表达式搜索替换。支持\1反向引用。--count N限制替换次数。 | | explain | 将正则表达式分解为每个元素的通俗英语解释。 | | validate | 检查正则表达式模式语法是否有效。 | | patterns | 列出内置常用模式或按名称显示特定模式。 |

输入选项

所有匹配命令接受:--text 字符串、--file 路径或通过管道传入的标准输入。

标志

标志描述
-i, --ignorecase不区分大小写匹配
-m, --multiline
^/$匹配行边界 | | -s, --dotall | .匹配换行符 |

内置模式

按名称使用,无需编写正则表达式: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

下载

⬇ 下载 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.
返回顶部