What it is
A regular expression exhibits catastrophic backtracking when certain inputs force the engine to explore an exponential number of ways to match (or fail to match), so execution time explodes with just a few extra characters — turning a normal-looking pattern into a denial-of-service vector if it ever runs on untrusted input.
When to use it
Use this before shipping a regex that will run on user-supplied input (form validation, log parsing, request routing) — it actually runs your pattern against a handful of adversarial strings at growing lengths and measures wall-clock time, rather than just reading the pattern's shape and guessing.
Gotchas & limits
The adversarial inputs are generated heuristically from the pattern's visible quantified groups and character classes, not from a full regex parser — a shape it doesn't recognize can be missed, and a "looks safe" verdict only covers the inputs actually tested, not a formal proof.