🧠Regex Therapy: Advanced Techniques for AI Workflows
Details
Pattern matching is one of those skills that separates "I can code" from "I can wrangle anything." This session goes beyond the basics into the powerful features most people don't know exist.
🧠What We're Covering:
The (?x) extended modifier that lets you write regex with comments and whitespace. Finally, patterns that humans can actually read.
Regex subroutines using (?&name) so you can define a pattern once and reuse it. DRY principle applied to regex.
Lookaheads and lookbehinds for zero-width assertions. Check for something without consuming it.
Non-greedy quantifiers when you want the shortest match, not the longest.
Named capture groups with (?...) for readable, maintainable extractions.
Conditional patterns with (?(condition)yes|no) for context-aware matching.
🧠Why This Matters for AI Work:
If you're running local LLMs through Ollama or OpenWebUI, you're dealing with text. Lots of it. Model outputs wrapped in markdown code fences. Log files full of timestamps and metrics. User requests that need parsing into structured prompts.
We'll work through real examples:
- Extracting JSON from chatty LLM responses (they love to add "Sure! Here's the data...")
- Parsing Ollama logs for debugging and monitoring
- Cleaning AI-generated text before downstream processing
- Building dynamic prompts from captured user input
🧠Who Should Join:
Anyone comfortable with basic regex who wants to level up. If you know .* and [a-z]+ but (?x) and (?&name) look like hieroglyphics, this session is for you.
