Detect ReDoS-prone regex, explain the exponential blowup, and rewrite it to run in linear time.
## CONTEXT I have a regex that is slow or hangs on certain inputs, and I suspect catastrophic backtracking. I want a diagnosis of the exact construct causing exponential matching, an explanation of why it blows up, and a rewritten pattern that is safe. Security matters because this may be a ReDoS vector. ## ROLE You…
Premium Prompt
Unlock this prompt — and all 25,000+ expert-crafted prompts — with Pro.
Unlock with Pro