Skip to content
affaan-m avatar

Regex Vs Llm Structured Text

Decision framework and hybrid regex-first pipeline for parsing structured text at lower LLM cost.

CCM score
69 of 100
skills.sh installs
12.2K
GitHub stars
312.6K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers when to choose regex, LLM, or both, with a decision tree based on how consistent the text format is
  • Includes a regex parser, a confidence scorer that flags items below 0.95, and an LLM validator that runs only on flagged items
  • Enforces immutable parsed items and points to a production quiz pipeline reporting 98% regex success and about 95% cost savings
  • Designed for quiz, form, invoice, and receipt extraction where repeating patterns make regex the cheaper first pass

Install

$ npx -y skills add affaan-m/ecc --skill regex-vs-llm-structured-text -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Regex vs LLM for Structured Text Parsing

A practical decision framework for parsing structured text (quizzes, forms, invoices, documents). The key insight: regex handles 95-98% of cases cheaply and deterministically. Reserve expensive LLM calls for the remaining edge cases.

When to Activate

  • Parsing structured text with repeating patterns (questions, forms, tables)
  • Deciding between regex and LLM for text extraction
  • Building hybrid pipelines that combine both approaches
  • Optimizing cost/accuracy tradeoffs in text processing

Decision Framework

Is the text format consistent and repeating?
├── Yes (>90% follows a pattern) → Start with Regex
│   ├── Regex handles 95%+ → Done, no LLM needed
│   └── Regex handles <95% → Add LLM for edge cases only
└── No (free-form, highly variable) → Use LLM directly

Architecture Pattern

Details

Repository
github.com/affaan-m/ecc
Categories
AI Agents & LLM Apps, Data Science & Analytics
First seen
Jul 14, 2026

Questions

What does the regex-vs-llm-structured-text skill do?

It is a decision framework for parsing structured text such as quizzes, forms, invoices, receipts and tables. It runs a regex-first pipeline that handles most items cheaply, flags low-confidence results with a confidence scorer, and sends only those edge cases to an LLM validator.

When should I use regex-vs-llm-structured-text instead of sending everything to an LLM?

Use it when the text format is consistent and repeating, for example when more than 90% of items follow a pattern. The skill explains that regex can handle 95% or more of cases deterministically, so an LLM is only needed for the remaining low-confidence items.

How do I install the regex-vs-llm-structured-text skill?

Run npx -y skills add affaan-m/ecc --skill regex-vs-llm-structured-text -y in your project. Once installed, the agent can build a hybrid regex and LLM document parser with confidence scoring for text extraction.

More from affaan-m/ecc

All 257

Similar to Regex Vs Llm Structured Text

More AI Agents & LLM Apps