What is ReDoS: the regex failure mode that takes down production?
Target query: regex denial of service catastrophic backtracking
Catastrophic backtracking happens when a pattern can match the same input in exponentially many ways, so a non-matching string of moderate length makes the engine explore a combinatorial space before it fails. Nested quantifiers over overlapping character classes are the usual cause. The tell is a pattern that behaves fine on your samples and hangs on adversarial input, which is exactly what an attacker sends. Practical containment: avoid nested quantifiers whose inner group can match the same characters as the outer, prefer possessive or atomic constructs where the dialect supports them, cap the input length before the regex ever runs, and add a match timeout on the call.