Skip to main content

Module regex_engine

Module regex_engine 

Source
Expand description

Dual regex engine abstraction for safe and fast pattern matching.

The regex safety audit (git_safety_guard-99e.11) found:

  • ~85% of pack patterns can use the linear-time regex crate
  • ~15% require lookahead/lookbehind (needs fancy_regex)

This module provides:

  • CompiledRegex: Eagerly compiled abstraction that auto-selects engine
  • LazyCompiledRegex: Lazily compiled regex using CompiledRegex (for pack patterns)

The lazy variant avoids regex compilation during pack registry initialization, improving startup latency for the common allow-path case.

Structs§

LazyCompiledRegex
A lazily-compiled regex pattern using CompiledRegex.

Enums§

CompiledRegex
A compiled regex that auto-selects between linear-time and backtracking engines.

Functions§

needs_backtracking_engine
Check if a pattern requires the backtracking engine.