Catastrophic Backtracking (ReDoS) Playground

The library’s catalogue kiosk: /^(a+)+$/ runs in a worker that stops it after 400 ms while the page keeps running. When does it freeze, and when does it…

Why it matters

ReDoS has taken down Cloudflare and Stack Overflow. Seeing the ways explode, and that it only happens when the match fails, lets you spot a dangerous pattern and fix it, rather than memorise rules.

The key idea

A nested quantifier explodes exponentially, but only when the match fails

Try it in this playground