Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

RegexAssistant

v1.0.1

帮助测试、调试和生成正则表达式,支持匹配测试、分组捕获、全文提取和替换操作。

0· 687·1 current·1 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for crossallen/regex-assistant.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "RegexAssistant" (crossallen/regex-assistant) from ClawHub.
Skill page: https://clawhub.ai/crossallen/regex-assistant
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install regex-assistant

ClawHub CLI

Package manager switcher

npx clawhub@latest install regex-assistant
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description describe a regex tester and the package contains a single CLI script (script/main.py) that implements match, findall, groups, sub, and pattern commands — all expected and proportionate.
Instruction Scope
SKILL.md only instructs running the included Python script with regex and text arguments. Example usage includes shell substitution like $(cat error.log) which demonstrates how a user can pass file contents into the tool; the skill itself does not instruct the agent to read system files or external data automatically.
Install Mechanism
No install spec; this is an instruction-only skill with a bundled script. Nothing is downloaded or written to disk beyond the included files.
Credentials
No environment variables, credentials, or config paths are required or referenced; requested access is minimal and appropriate for a local regex helper.
Persistence & Privilege
No elevated persistence requested (always=false). The skill does not modify other skills or system-wide settings.
Assessment
This skill appears to do what it says: a local regex tester implemented in a small Python script and documentation. Key points to consider before installing/using: (1) it runs locally and needs no credentials, so there's no obvious network exfiltration built in; (2) be cautious when passing sensitive files as arguments or via shell substitution (e.g., $(cat secret.txt)) since the tool will print matches and replaced text to stdout; (3) you can quickly review the short script (script/main.py) — it contains only standard Python regex usage with no network or filesystem access beyond what you explicitly provide as arguments. If you require higher assurance, run the script in a sandbox or review/execute it locally before granting it any automated invocation.

Like a lobster shell, security has layers — review code before you run it.

latestvk97dgp1y5w017ez9btrcy6vdsn815m5f
687downloads
0stars
1versions
Updated 16h ago
v1.0.1
MIT-0

正则表达式助手 (Regex Tester)

正则表达式测试与调试工具,帮助开发者快速验证正则表达式、提取匹配结果和执行替换操作。

技能目的

提供便捷的正则表达式测试环境,帮助用户:

  • 验证正则表达式是否正确匹配目标文本
  • 查看捕获分组的内容
  • 执行替换操作并预览结果
  • 获取详细的匹配信息

何时使用此技能

在以下情况下使用此技能:

  • 需要测试或调试正则表达式
  • 需要从文本中提取特定模式的内容
  • 需要进行批量文本替换
  • 需要了解正则表达式的匹配行为
  • 需要生成常用正则表达式模式

功能特性

1. 基本匹配测试

测试正则表达式在目标文本中的匹配情况。

python3 script/main.py match "<正则>" "<文本>"

示例:

# 测试邮箱匹配
python3 script/main.py match "[\w.+-]+@[\w-]+\.[\w.-]+" "contact@example.com"

# 测试手机号匹配(中国大陆)
python3 script/main.py match "1[3-9]\d{9}" "13800138000"

2. 提取所有匹配

获取文本中所有匹配正则表达式的内容。

python3 script/main.py findall "<正则>" "<文本>"

示例:

# 提取所有URL
python3 script/main.py findall "https?://\S+" "访问 https://example.com 和 http://test.org"

# 提取所有数字
python3 script/main.py findall "\d+" "价格: 99, 数量: 100, 总计: 9900"

3. 分组捕获

查看正则表达式中的捕获分组内容。

python3 script/main.py groups "<正则>" "<文本>"

示例:

# 解析日志格式
python3 script/main.py groups "\[(.*?)\] \[(.*?)\] (.*)" "[2024-02-14] [INFO] 启动服务"

# 解析日期时间
python3 script/main.py groups "(\d{4})-(\d{2})-(\d{2})" "今天是2024-02-14"

4. 文本替换

使用正则表达式进行文本替换。

python3 script/main.py sub "<正则>" "<替换内容>" "<文本>"

示例:

# 隐藏手机号中间四位
python3 script/main.py sub "(\d{3})\d{4}(\d{4})" "\1****\2" "联系13800138000"

# 去除HTML标签
python3 script/main.py sub "<[^>]+>" "" "<p>你好<b>世界</b></p>"

5. 常用模式生成

生成常用场景的正则表达式模式。

python3 script/main.py pattern "<模式名称>"

支持的模式:

  • email - 邮箱地址
  • phone - 中国手机号
  • idcard - 中国身份证号
  • ipv4 - IPv4地址
  • url - URL地址
  • date - 日期 (YYYY-MM-DD)
  • time - 时间 (HH:MM:SS)
  • chinese - 中文字符
  • username - 用户名 (字母数字下划线)
  • password - 密码 (至少8位,包含字母和数字)

示例:

python3 script/main.py pattern email
python3 script/main.py pattern phone

参数说明

参数说明
match测试基本匹配
findall提取所有匹配
groups查看分组捕获
sub执行替换操作
pattern生成常用模式

使用示例

场景 1: 验证输入格式

# 验证邮箱格式是否正确
python3 script/main.py match "[\w.+-]+@[\w-]+\.[\w.-]+" "user@company.com"

场景 2: 提取数据

# 从日志中提取所有错误代码
python3 script/main.py findall "ERROR:\s*(\w+)" "$(cat error.log)"

# 提取Markdown中的链接
python3 script/main.py findall "\[([^\]]+)\]\(([^)]+)\)" "[首页](https://example.com)"

场景 3: 数据清洗

# 统一日期格式
python3 script/main.py sub "(\d{4})/(\d{2})/(\d{2})" "\1-\2-\3" "2024/02/14"

# 去除多余空格
python3 script/main.py sub "\s+" " " "你好     世界"

场景 4: 查看正则分组

# 解析命令行参数
python3 script/main.py groups "--(\w+)=([^\s]+)" "--name=test --port=8080"

# 解析CSV格式
python3 script/main.py groups "([^,]+),([^,]+),([^,]+)" "张三,25,北京"

正则表达式语法速查

符号说明
.匹配任意字符(除换行)
\d匹配数字
\w匹配字母数字下划线
\s匹配空白字符
^匹配行首
$匹配行尾
*匹配0次或多次
+匹配1次或多次
?匹配0次或1次
{n}匹配n次
{n,}匹配至少n次
{n,m}匹配n到m次
[abc]匹配a、b或c
[^abc]匹配非a、b、c的字符
()捕获分组
(?:)非捕获分组
``

注意事项

  1. 特殊字符需要转义:. ^ $ * + ? { } [ ] \ | ( )
  2. 使用 .* 时注意贪婪匹配,可用 .*? 进行非贪婪匹配
  3. 捕获分组编号从1开始,group(0) 是整个匹配结果
  4. Python默认使用Unicode模式,可匹配中文等Unicode字符

目录结构

regex-assistant/
├── SKILL.md              # 技能说明文档(本文件)
├── script/
│   └── main.py          # 主程序
└── tests/               # 测试用例

Comments

Loading comments...