360 Secure SkillHub
360 安全技能中心

Rxtool

这是一款功能全面的正则表达式工具,核心功能包括测试正则匹配、提取文本匹配内容、替换指定匹配项、按正则拆分文本,以及拆解解释正则规则。支持命名/编号分组、多模式flags,可通过命令行参数或stdin管道输入,提取结果支持JSON输出,适用于验证正则、提取关键信息、批量文本处理等场景。

rogue-agent1
rogue-agent1
热度 46.40
最近更新 2026-05-11 17:37:31
分类:效率依赖:代码执行应用场景:数据处理 / 概念解释

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add rxtool
Metadata
name
rxtool
description
Test, extract, replace, split, and explain regular expressions. Use when asked to test a regex pattern, extract matches from text, do regex replacements, split text by pattern, or understand what a regex does. Supports named groups, case-insensitive/multiline/dotall flags, and JSON output. Works with stdin pipes or inline text. Zero dependencies.

rxtool 🔤

Regex Swiss army knife — test, extract, replace, split, explain.

Commands

# Test a pattern against text
python3 scripts/rxtool.py test '(\d+)-(\d+)' "order-123-456"

# Extract all matches
python3 scripts/rxtool.py extract '\b\w+@\w+\.\w+\b' "email me at user@example.com"

# Extract with JSON output
echo "text" | python3 scripts/rxtool.py extract '\w+' --json

# Replace matches
python3 scripts/rxtool.py replace '\d+' 'NUM' "got 42 items and 7 boxes"

# Split by pattern
python3 scripts/rxtool.py split '[,;\s]+' "a, b; c d"

# Explain a regex
python3 scripts/rxtool.py explain '(?P<year>\d{4})-(?P<month>\d{2})'

Features

  • Group capture (numbered and named)
  • Case-insensitive (-i), multiline (-m), dotall (-s) flags
  • Stdin pipe support
  • JSON output for extraction
  • Regex explanation with component breakdown