Regex vs LLM for Structured Text
Cheap document parsing for Muse: a regex-first pipeline that handles 95%+ of structured text, with a confidence scorer and LLM validation only for edge cases. ~95% cost savings.
- What
- Cheap document parsing for Muse: a regex-first pipeline that handles 95%+ of structured text, with a confidence scorer and LLM validation only for edge cases. ~95% cost savings.
- Cost
- Free
- Needs
- none to install. Pure guidance; an LLM API key helps if you want the validator stage (cheapest Haiku-class model is enough).
- Level
- Intermediate
- Install
- Copy the installer prompt below into your Muse — your agent does the rest.
Curated by Skill Harbor: a decision framework and hybrid pipeline for parsing structured text that keeps Muse from burning money on LLM calls regex could have handled. The key insight: regex handles 95-98% of cases cheaply and deterministically, reserve expensive LLM calls for the remaining edge cases. Architecture: a regex parser extracts structure first, a text cleaner removes noise (markers, page numbers, artifacts), a confidence scorer flags low-confidence extractions (few choices, missing answer, short text), and an LLM validator fixes only the flagged items, returning corrected JSON or CORRECT. Includes a complete Python implementation (frozen dataclasses, never mutate parsed items), real-world metrics from a production quiz pipeline (410 items: 98.0% regex success, 8 low-confidence items, about 5 LLM calls, ~95% cost savings versus all-LLM, 93% test coverage), a decision tree (consistent repeating format goes regex-first, free-form variable text goes LLM directly), best practices (start with regex even imperfect, cheapest Haiku-class model for validation, TDD for parsers, log pipeline metrics), and anti-patterns to avoid (sending everything to an LLM, regex for free-form text, skipping confidence scoring, mutating parsed objects). Use when parsing quizzes, forms, invoices, receipts or tables, choosing between regex and LLM for extraction, or optimizing extraction cost and accuracy. By @affaan-m, listed here with credit to its creator. From the affaan-m/ECC repository (MIT). Honest caveats: metrics come from one production pipeline, your mileage may vary with messier inputs ; LLM validation needs an API key and a client ; regex still needs tests for edge cases and encoding issues. Skill Harbor never reviews the code, review it yourself before use.
Version:
Quick answer
Regex vs LLM for Structured Text is a free skill for Muse. a decision framework and hybrid pipeline for parsing structured text that keeps Muse from burning money on LLM calls regex could have handled. The key insight: regex handles 95-98% of cases cheaply and deterministically, reserve expensive LLM calls for the remaining edge cases.
Install
Copy the install package below, then paste it into Muse🧪 Install ran in our test sandbox · Nov 11, 2026📌 Pinned version: commit 4eb71d9Pinned version: install the code at commit 4eb71d92a39cab44ad40ac9d8a6a5ccb4029d6c2 exactly (Skill Harbor tested this version). Do not substitute a newer version. If this commit is unreachable, stop and tell me. Use "Regex vs LLM for Structured Text" with your Muse. Prerequisites: none to install. Pure guidance; an LLM API key helps if you want the validator stage (cheapest Haiku-class model is enough). 1. Open the skill: https://raw.githubusercontent.com/affaan-m/ECC/4eb71d92a39cab44ad40ac9d8a6a5ccb4029d6c2/skills/regex-vs-llm-structured-text/SKILL.md and copy the full SKILL.md text. 2. Paste it into a chat with Muse and add: "Design a hybrid regex-first extraction pipeline for: [describe your documents]." 3. Ask it to start with the regex parser and confidence scorer, add LLM validation only for flagged items, and log regex success rate versus LLM call count. Tip: run the decision tree first ("is this format consistent and repeating?") before writing any parser code. Safety: a skill is plain-text instructions; it runs nothing by itself. Review generated code before merging.
Saved to your recent installs. Find it anytime on /connect.
🔒 Security, provenance and what this touches
- It works with an API key or a token that you provide.
What the scan found — excerpts from the install prompt
- uses API keys or tokens — Prerequisites: none to install. Pure guidance; an LLM API key helps if you want the validator stage (cheapest · Prérequis : rien à installer. Pur guide ; une clé API LLM aide si vous voulez l'étape de validation (le modèle
The install prompt below already includes the vetting steps: your agent follows the community checklist before installing anything with executable code. Want more?
Verification certificate
Dated facts about what was checked for this listing, and how. This is not a safety certification.
- Pinned version
- 4eb71d9 · 2026-10-13
- Sandbox install test
- Install ran in our test sandbox · Nov 11, 2026
- Creator identity
- Not verified
- Fingerprint watch
- Last checked · Nov 21, 2026 : no change detected in the files linked by this install prompt
- Install prompt analysis
- 2026-10-13 : uses API keys or tokens
Skill Harbor never reviews the code of a listed skill. These are dated facts about the install prompt and our install test, not a safety certification. Review a skill yourself before you install it. How we verify
Questions
How do I install a skill?
Every product page includes a copy-paste install prompt. Paste it into your Muse and it sets the skill up for you — no manual configuration.
Where does my money go?
Straight to the seller. Skill Harbor never processes payments: checkout happens on the seller’s own page, usually Stripe.
What does the ✓ next to a creator’s name mean?
It means we confirmed the identity of the person behind the listing. It says nothing about the code itself — always check a skill before installing it.