
Regex Vs Llm Structured Text
This is the sensible middle ground between overengineered regex and expensive LLM calls for every parsing task. Use regex to handle the 95-98% of structured text that follows a pattern, add confidence scoring to flag edge cases, then only call an LLM for the 2-5% that need it. The production metrics are honest: 410 quiz items parsed with 8 low-confidence flags and roughly 5 LLM calls needed, saving 95% vs an all-LLM approach. The architecture is clean, the code samples are immutable and testable, and the decision framework actually helps you pick the right tool. If you're parsing invoices, forms, or any repeating structure where cost matters, this is worth your time.
- skills.sh installs
- 5.1K
- GitHub stars
- 229.1K
- last updated
- Jul 14, 2026
Install
$ npx -y skills add affaan-m/everything-claude-code --skill regex-vs-llm-structured-text --agent claude-codeInstalls into .claude/skills of the current project.
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
Sponsors
Details
- Repository
- github.com/affaan-m/everything-claude-code
- Category
- AI & Agent Building
More from affaan-m/everything-claude-code
All 256- Compose Multiplatform Patterns5K
- Continuous Agent Loop5K
- Foundation Models On Device5K
- Investor Outreach5K
- Kotlin Patterns5K
- Rust Patterns5K
- Swift Actor Persistence5K
- Swift Protocol Di Testing5K
- Bun Runtime4.9K
- Nextjs Turbopack4.9K
- Plankton Code Quality4.9K
- Swift Concurrency 6 24.9K
- Visa Doc Translate4.9K
- Ai Regression Testing4.8K
- Architecture Decision Records4.8K
- Blueprint4.8K
- Everything Claude Code Conventions4.8K
- Exa Search4.8K
- Kotlin Testing4.8K
- Customs Trade Compliance4.7K
- Data Scraper Agent4.7K
- Documentation Lookup4.7K
- Enterprise Agent Ops4.7K
- Flutter Dart Code Review4.7K