Regex Catastrophic Backtracking: The Timing Curve I Measured
A nested-quantifier regex went from 46ms to 31.6 seconds as input length grew from 20 to 32 characters The safe rewrite stayed under 0.2ms at every length I tested, no slowdown at all At 34 characters the vulnerable pattern didn't return within 2 minutes, so I killed the process The fix is almost a…
Read the full story at DEV Community — AI ↗
Timeline · 1 report
- 2026-11-10 00:49 · DEV Community — AI
Regex Catastrophic Backtracking: The Timing Curve I Measured