regex-vs-llm-structured-text

Parse structured text using a hybrid regex and LLM decision framework.

2|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/klu-dev/porting-ecc-to-vscode --skill regex-vs-llm-structured-text-klu-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regex-vs-llm-structured-text
Source: https://github.com/klu-dev/porting-ecc-to-vscode/tree/main/.github/skills/regex-vs-llm-structured-text
Command: npx skills add https://github.com/klu-dev/porting-ecc-to-vscode --skill regex-vs-llm-structured-text-klu-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a framework for deciding between regex and LLM when parsing structured text, optimizing cost/accuracy trade-offs and automating tasks.

Core Features & Use Cases

  • Decision Framework: A simple flowchart for determining when to use regex and when to incorporate LLM for edge cases.
  • Hybrid Parsing: Combines regex for deterministic tasks and LLM for low-confidence cases in structured text.
  • Use Case: Use this Skill to parse questions, forms, invoices, and documents where consistent patterns can be extracted with regex, with LLM employed for parsing irregularities or edge cases.

Quick Start

Parse the attached structured text document using the regex-and-LLM framework.

Frequently Asked Questions about regex-vs-llm-structured-text

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I combine regex and LLM for structured text parsing?

Combine regex and LLM for structured text parsing by using regex for deterministic pattern extraction and routing low-confidence edge cases to the LLM, optimizing cost and accuracy across varied document inputs.

When should I use an LLM instead of regex to parse documents?

Use an LLM instead of regex to parse documents when encountering irregularities or edge cases that deterministic patterns cannot capture, applying a hybrid decision framework to balance parsing accuracy and cost.

What is the best way to parse invoices with irregular text patterns?

The best way to parse invoices with irregular text patterns is a hybrid approach, extracting consistent data fields with regex and delegating parsing irregularities to an LLM to handle edge cases efficiently.

Does a hybrid regex and LLM approach reduce text parsing costs?

A hybrid regex and LLM approach reduces text parsing costs by limiting expensive LLM calls to low-confidence edge cases, while regex handles the bulk of deterministic structured text extraction automatically.

How do I build a decision framework for text parsing automation?

Build a decision framework for text parsing automation by mapping consistent patterns to regex extraction and defining thresholds for LLM fallback, ensuring efficient analysis of forms and structured documents.