August 3, 2026
The regex wars strike again
The true power of regular expressions (2012)
Regex fans clap back as the internet revives the “just use a parser” fight
TLDR: The article argues that modern regular expressions can do much more than the old “don’t use them on HTML” warning implies. In the comments, people split between calling regex dangerous wizardry and insisting it’s perfectly fine for quick, practical searches most of the time.
A 2012 essay about the real power of regular expressions just reopened one of coding’s most eternal food fights: when someone asks how to search messy web page text, do you reach for a quick pattern match, or do the purists storm in yelling, “Absolutely not”? The article’s big point is surprisingly simple for non-experts: the classic line “you can’t parse HTML with regular expressions” is often used way too broadly. In plain English, the author argues that modern pattern-matching tools can do far more than the old textbook warning suggests.
And wow, the comment section did not come to play nice. One side rolled in with the legendary joke about regular expressions giving you “three problems” instead of one, because no internet discussion about regex is complete without someone acting like they’re cursed wizard spells. Another commenter basically backed that up by admitting they paste regex into code with a link to the “spell book” so future them can remember what on earth it means. That joke landed because, honestly, half the crowd seems to agree regex is equal parts genius and dark magic.
But the defenders fought back hard. One of the strongest takes said critics miss the point: most people aren’t trying to understand an entire web page with one monster pattern, they just want to find something small like a tag, and for that a simple search works “in 99.9% of cases.” Others compared regex to jq, saying its confusing look is exactly why it’s powerful: tiny, sharp, and perfect for one-liners. Bonus chaos came from a commenter dropping a gleefully apocalyptic link titled “Doom Using Regular Expressions”, because of course this debate needed a dramatic soundtrack.
Key Points
- •The article argues that saying HTML cannot be parsed with regex is misleading in many practical programming contexts.
- •It defines regular grammars using production-rule forms such as B -> a, B -> aC, and B -> ε.
- •A grammar for natural numbers is used to show how a regular grammar can be represented more concisely as the regex [0-9]+.
- •The article distinguishes formal regular expressions from the regex implementations used in programming languages.
- •It uses PCRE, as used by PHP, and the Chomsky hierarchy to frame a broader discussion of regex matching power.