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
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 -yInstalls 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- Compose Multiplatform Patterns12.2K
- Continuous Agent Loop12.2K
- Content Hash Cache Pattern12.1K
- Kotlin Testing12.1K
- Ai Regression Testing12.1K
- Browser Qa12.1K
- Design System12.1K
- Jira Integration12K
- Investor Outreach12K
- Documentation Lookup12K
- Remotion Video Creation12K
- Swift Actor Persistence12K
- Swift Protocol Di Testing12K
- Blueprint12K
- Git Workflow11.9K
- Foundation Models On Device11.9K
- Exa Search11.9K
- Swift Concurrency 6 211.9K
- Nestjs Patterns11.9K
- Data Scraper Agent11.9K
- Hexagonal Architecture11.9K
- Mcp Server Patterns11.9K
- Plankton Code Quality11.9K
- Fal Ai Media11.8K
Similar to Regex Vs Llm Structured Text
More AI Agents & LLM Appscost-aware-llm-pipelineaffaan-m/ecc12.7K installsComposable LLM cost controls combining model routing, budget tracking, narrow retries, and prompt caching.
guidanceorchestra-research/ai-research-skills1.1K installsConstrained generation framework that forces LLM output into regex, grammar, or selection formats from Microsoft Research.
llm-evaluationwshobson/agents13.9K installsComprehensive evaluation strategies for LLM apps combining automated metrics, human review, and LLM-as-judge scoring.
prompt-engineerjeffallan/claude-skills6.1K installsStructured prompt-design skill that writes, refactors, and evaluates LLM prompts, schemas, and test suites.
outlinesorchestra-research/ai-research-skills1.1K installsGuaranteed-valid structured generation with Pydantic models, JSON schemas, and local model backends.
structured-output-extractorpatricio0312rev/skills324 installsStructured-output extraction from LLM responses via JSON mode, Zod schemas, and function calling for typed parsing.