Magical journey through regex engine internals
summary
Explains how regex engines differ: Thompson NFA (linear, used by Go/RE2) versus backtracking/Perl-style engines that allow more features but can run exponential, shown by a demo that hits >100k steps and freezes a browser for nearly a minute. Cites real incidents: Cloudflare outage (~2019, ~30 minutes) and Stack Overflow quadratic failure from an answer with ~20,000 trailing spaces. Recommends avoiding greedy .* and nested quantifiers, using atomic/possessive constructs, or switching to RE2/timeouts.
AI-written summary · about
