Skip to main content

Module regex_cache

Module regex_cache 

Source
Expand description

Compiled-regex cache for patterns a user or model supplies (tool search, purge). Those patterns are untrusted input, so compilation is bounded: the pattern length is capped, the compiled program and lazy DFA have explicit size limits, compilation runs outside the cache lock, and a rejected pattern is remembered so repeating it costs a lookup.

Constants§

MAX_USER_REGEX_PATTERN_BYTES
Longest pattern accepted, in bytes. Search and purge patterns are short.

Functions§

compile_user_regex