360 Secure SkillHub
360 安全技能中心

Regex Tool

该 Skill 提供 regex-tool 命令行工具,按给定正则模式在文件中查找、提取或替换文本,支持忽略大小写、仅输出匹配项、全局匹配与替换选项,适用于数据校验与文本解析场景。

dinghaibin
dinghaibin
热度 30.69
最近更新 2026-05-11 17:47:06
分类:效率依赖:代码执行 / 读写文件应用场景:数据处理

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add regex-tool
Metadata
name
regex-tool
description
Match and extract text patterns using regular expressions. Use for data validation, text parsing, and pattern-based extraction tasks.

Regex - Regular Expression Matcher

Search text using regular expressions to find, extract, and replace patterns. Supports standard regex syntax with capturing groups, alternation, and quantifiers for advanced text processing.

Usage

regex-tool [options] <pattern> <file>

Options

  • -i: Case-insensitive matching
  • -o: Show only matched text
  • -r REPLACE: Replace matches with text
  • -g: Global match (all occurrences)

Examples

regex-tool "\d{4}-\d{2}-\d{2}" dates.txt
regex-tool -i "error|warning" log.txt
regex-tool -r "[REDACTED]" "\b\d{3}-\d{2}-\d{4}\b" data.txt