Individual skill

regex-vs-llm-structured-text

在解析结构化文本时,用于在正则表达式(Regex)和大型语言模型(LLM)之间进行选择的决策框架——优先使用正则表达式,仅针对低置信度的边界情况引入 LLM。

skills/regex-vs-llm-structured-text/SKILL.md

Read pinned source

Source commit dfbf9467b90dfd29bffa842c4e0a6977112900e2

What was checked

Matches the observed repository HEAD
Yes
Scanner rules are current
Yes
Repository scan complete
No
Skill scan complete
No
Observed behavior
Local scripts
Last checked
Nov 3, 2026

These are observations at the recorded commit, not a guarantee of safety. Review the source before running it.

Install this skill

Choose an agent in your Stack or copy a command below. Commands fetch the pinned commit and copy only this skill directory. Existing destinations are refused. Copying a command does not install anything.

An install command is unavailable: current rules, complete repository and skill scans, an eligible behavior level and a permitted license are required.

Repository context

Repository stars (not skill ratings)
2,025
Repository last updated
Mar 5, 2026
License
MIT

Observed agent integration: No specific integration evidence. Standard SKILL.md installation does not imply verified compatibility.

Files and excerpt

File metadata and permitted, redacted excerpts come from the recorded scan. Source links are pinned to that commit.

Browse files
Read excerpt

# 结构化文本解析:正则表达式(Regex)与大语言模型(LLM)的抉择

这是一个用于解析结构化文本(测验、表单、发票、文档)的实用决策框架。核心见解是:正则表达式(Regex)能以极低的成本确定性地处理 95-98% 的情况。应将昂贵的 LLM 调用保留给剩余的边界情况(Edge Cases)。

## 何时激活(When to Activate)

- 解析具有重复模式的结构化文本(问题、表单、表格等)
- 在文本提取任务中权衡使用正则表达式还是 LLM
- 构建结合这两种方法的混合流水线(Hybrid Pipelines)
- 在文本处理中优化成本与准确性的平衡

## 决策框架(Decision Framework)

```