Skip to main content

REGEX_BACKTRACK_LIMIT

Constant REGEX_BACKTRACK_LIMIT 

Source
pub const REGEX_BACKTRACK_LIMIT: usize = 1_000_000;
Expand description

Maximum backtracks the fancy-regex matcher is allowed per call. Rules carrying a matches operator are compiled with this limit baked in; the matcher returns Err(Error::BacktrackLimitExceeded) when a pathological input would otherwise spin (RegEx DoS).

1e6 is the spec figure and roughly matches “100 ms on a single core” for typical adversarial inputs in benchmark harnesses.