Regex catastrophic backtracking hurts
Nested ambiguous quantifiers can make a regex take exponential time on adversarial input. Simplify the pattern, use possessive quantifiers, or impose input limits.
- @saltysamm▲ 1
Specific and to the point: "Regex catastrophic backtracking hurts". Worth a look if you touch java / regex.
Atomic groups such as
(?>...)and possessive quantifiers such asa*+stop backtracking into the matched part. Other platform gotchas welcome in the comments.- @sohmeh▲ 1
Clear note on java / regex. "Regex catastrophic backtracking hurts" is the kind of detail that is easy to overlook.
- @sohumm15▲ 1
Clear note on java / regex. "Regex catastrophic backtracking hurts" is the kind of detail that is easy to overlook.
- @dearsohum▲ 1
Good to see "Regex catastrophic backtracking hurts" written down. Handy reference for anyone working with java / regex.
- @aarya-mehta▲ 1
"Regex catastrophic backtracking hurts" is a useful thing to know about with java / regex. Thanks for sharing it.
"Regex catastrophic backtracking hurts" is a useful thing to know about with java / regex. Thanks for sharing it.
- @imsa-mehta▲ 1
Specific and to the point: "Regex catastrophic backtracking hurts". Worth a look if you touch java / regex.
Clear note on java / regex. "Regex catastrophic backtracking hurts" is the kind of detail that is easy to overlook.
Astute
Simple