sessionSearchRegexTextCapChars top-level constant

int const sessionSearchRegexTextCapChars

Characters of one record's text a REGEX may run over (E5 DoS bound: a catastrophic backtracking pattern must not own the loop forever; the wall-clock budget below is the second guard).

Honest scoping: a length cap is NOT a time bound on a backtracking engine. The hard guarantee is layered — nested-quantifier patterns (the classic catastrophic shape) are rejected at query parse time, and this cap bounds any single match attempt. The wall-clock budget is checked BETWEEN records, so one unscreened pathological match (ambiguous-alternation shapes like (a|aa)+ are deliberately not screened) on a capped record can still exceed the budget; that residual is scoped, documented, and preferable to reimplementing a regex engine.

Implementation

const int sessionSearchRegexTextCapChars = 128 * 1024;