A few months ago, I was building a tool to automatically parse invoice emails. You know the drill: subject line like "Invoice #12345 from ACME Corp - $1,234.56 due 2024-03-15". Seemed straightforward. I spent a day crafting the perfect regex pattern, feeling smug when it worked on the first 10 emails.

Then email #11 arrived. The subject was "Your invoice from ACME Corp (ref: INV-12345) – please pay $1,234.56 by 2024-03-15". My regex broke. I tweaked it. Then email #12 had "INVOICE: ACME Corp, Amount Due: $1,234.56, Due Date: 2024-03-15". My regex grew into a monster with optional groups and lookaheads. I knew I was on the wrong path.

The Dead Ends

More Regex

I tried building a library of patterns. It worked for about 60% of cases. Every new vendor introduced a new format. Maintenance was a nightmare. I spent more time debugging regex than building features.