Token导航 LogoToken导航

Agent Skill · 开发

regex-log(正则表达式日志)

regex-log 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

regex-log 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 13,855。

总安装 808周安装 33GitHub Stars 93下载 259核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:regex-log(正则表达式日志)
来源仓库:https://github.com/letta-ai/skills
仓库路径:skills/regex-log
安装命令:
npx skills add https://github.com/letta-ai/skills --skill regex-log
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/letta-ai/skills --skill regex-log

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

regex-log 用于日志条目解析,适合在 Codex、Claude、Cursor、Gemini CLI 中需要提取错误码、时间戳或事件类型时使用。它能将非结构化日志转为结构化数据。可通过 npx skills add 命令从 GitHub 仓库安装并使用。需适配不同日志格式,避免误匹配无关字段。

regex-log 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/regex-log

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/letta-ai/skills --skill regex-log;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

regex-log 怎么安装?

在终端执行 npx skills add https://github.com/letta-ai/skills --skill regex-log。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

regex-log 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

regex-log 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

regex-log 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

regex-log 用的人多吗?

公开数据是累计安装 808 次,近一周安装 33 次,下载 259 次,GitHub 93 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

regex-log 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
regex-log

正则表达式日志 · 本页

80893只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Regex Log Parsing Skill

This skill provides a systematic approach for constructing complex regular expressions that extract and validate structured data from log files.

When to Use This Skill

This skill applies when:

  • Building regex patterns to extract data from log entries
  • Validating specific formats (IPv4 addresses, dates, timestamps) within logs
  • Handling requirements for first/last occurrence selection
  • Enforcing word boundary conditions
  • Combining multiple validation constraints in a single pattern

Approach: Decomposition Strategy

Complex log parsing regex should be built by decomposing the problem into sub-patterns:

Step 1: Identify All Requirements

Before writing any regex, create a complete list of requirements:

  • What data needs to be validated (present but not captured)?
  • What data needs to be captured?
  • What boundary conditions apply (word boundaries, line anchors)?
  • Are there positional requirements (first, last, nth occurrence)?
  • What constitutes an invalid match?

Step 2: Build Sub-Patterns Independently

Construct each validation pattern separately before combining:

IPv4 Address Pattern

For valid IPv4 addresses (0-255 per octet, no leading zeros except for 0 itself):

  • Octet pattern: (?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])
  • Order alternatives from most specific to least specific
  • Full IPv4: (?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])
Date Pattern (YYYY-MM-DD)

For valid dates with proper month-day validation:

  • 31-day months: (?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])
  • 30-day months: (?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)
  • February (up to 29): 02-(?:0[1-9]|1[0-9]|2[0-9])
  • Combine with year: [0-9]{4}-(?:...combined month-day patterns...)

Step 3: Apply Positional Requirements

Selecting Last Occurrence

To capture the last valid pattern in a line:

^.*<pattern>(?!.*<pattern>)
  • Use ^.* to greedily consume characters
  • Use negative lookahead (?!.*<pattern>) to ensure no pattern follows
Selecting First Occurrence

To capture the first valid pattern:

^(?:(?!<pattern>).)*<pattern>

Or simply rely on regex engines returning the first match by default.

Step 4: Apply Validation Without Capture

To require presence of a pattern without capturing it:

  • Use lookahead: (?=.*<pattern>) at the start of the regex
  • This validates the line contains the pattern without affecting the capture

Step 5: Apply Word Boundaries

For patterns that must not be adjacent to alphanumeric characters:

  • Use \b word boundaries: \b<pattern>\b
  • Be aware that \b matches between word and non-word characters

Verification Strategy

Create Comprehensive Test Cases

Organize tests by category:

  1. Valid cases: Confirm expected matches

- Minimum/maximum valid values (e.g., 0.0.0.0, 255.255.255.255) - Edge values for each component

  1. Invalid format cases: Confirm rejection

- Out-of-range values (e.g., 256.0.0.0) - Invalid formatting (leading zeros where prohibited) - Invalid months (00, 13) or days (32)

  1. Boundary condition cases:

- Pattern at start/end of line - Pattern adjacent to alphanumeric characters (should fail with word boundaries) - Pattern adjacent to punctuation (should pass with word boundaries)

  1. Positional cases:

- Multiple valid patterns in one line (verify correct one is captured) - Single pattern in line - No valid pattern in line

Test File Structure

Create a structured test file that:

  • Groups tests by category
  • Uses clear naming for each test case
  • Reports pass/fail status for each test
  • Summarizes overall results

Example structure:

test_cases = {
    "valid_ipv4": [...],
    "invalid_ipv4": [...],
    "valid_dates": [...],
    "invalid_dates": [...],
    "last_occurrence": [...],
    "boundary_conditions": [...]
}

Common Pitfalls

1. Incomplete First Attempt

  • Problem: Creating incomplete or truncated test files
  • Solution: Plan the full test structure before writing; validate file completeness before execution

2. Environment Assumptions

  • Problem: Assuming python command exists when only python3 is available
  • Solution: Check the Python environment first or use python3 explicitly

3. Scattered Reasoning

  • Problem: Disorganized thought process leading to repeated work
  • Solution: Follow the decomposition strategy linearly; complete each sub-pattern before moving to the next

4. Duplicate Patterns Without Abstraction

  • Problem: Same regex pattern repeated multiple times, increasing error risk
  • Solution: Define complex sub-patterns once in reasoning, then reference them; in code, use variables

5. Missing Edge Cases

  • Problem: Focusing only on happy path validation
  • Solution: Explicitly test:

- Boundary values (min/max for each component) - Invalid values just outside valid range - Empty and null cases - Patterns at different positions in the line

6. Order of Alternatives

  • Problem: Less specific alternatives matching before more specific ones
  • Solution: Order regex alternatives from most specific to least specific (e.g., 25[0-5] before 2[0-4][0-9] before [0-9])

7. Greedy vs Non-Greedy Matching

  • Problem: Unexpected capture due to greedy quantifiers
  • Solution: Understand when to use .* vs .*?; for "last occurrence" patterns, greedy .* is typically correct

Workflow Summary

  1. List all requirements explicitly
  2. Build and test sub-patterns independently
  3. Combine sub-patterns with appropriate anchors and lookaheads
  4. Create comprehensive test cases covering all categories
  5. Run tests and verify all pass
  6. Clean up test files after validation

平台分布

Claude Code

26.97%
按下载量换算70

Gemini CLI

22.01%
按下载量换算57

Antigravity

16.37%
按下载量换算42

windsurf

12.22%
按下载量换算32

OpenCode

8.44%
按下载量换算22

Codex

3.52%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills