Skip to main content

safe_regex

Function safe_regex 

Source
pub fn safe_regex(pattern: &str) -> Result<Regex, DbError>
Expand description

Create a regex with safety limits to prevent ReDoS attacks. While the Rust regex crate is inherently ReDoS-resistant (uses Thompson NFA), we still limit pattern size and compiled size to prevent memory exhaustion.