pub struct EngineOptions {
pub dfa_threshold: usize,
pub max_dfa_capacity: usize,
pub lookahead_context_max: u32,
pub unicode: UnicodeMode,
pub case_insensitive: bool,
pub dot_matches_new_line: bool,
pub ignore_whitespace: bool,
pub hardened: bool,
}Expand description
Engine configuration, passed to Regex::with_options.
Fields§
§dfa_threshold: usizestates to eagerly precompile (0 = fully lazy).
max_dfa_capacity: usizemax cached DFA states; clamped to u16::MAX.
lookahead_context_max: u32max lookahead context distance (default: 800).
unicode: UnicodeModeUnicode coverage for \w and \d (default: UnicodeMode::Unicode).
case_insensitive: boolglobal case-insensitive matching (default: false).
dot_matches_new_line: bool. matches \n (default: false). _ always matches any byte.
ignore_whitespace: boolallow whitespace and # comments in the pattern (default: false).
hardened: booluse O(N·S) hardened forward scan (default: false). prevents quadratic blowup on adversarial pattern+input combinations.
Implementations§
Source§impl EngineOptions
impl EngineOptions
Sourcepub fn unicode(self, mode: UnicodeMode) -> Self
pub fn unicode(self, mode: UnicodeMode) -> Self
set Unicode coverage for \w and \d.
Sourcepub fn case_insensitive(self, yes: bool) -> Self
pub fn case_insensitive(self, yes: bool) -> Self
set case-insensitive mode.
Sourcepub fn dot_matches_new_line(self, yes: bool) -> Self
pub fn dot_matches_new_line(self, yes: bool) -> Self
set dot-matches-newline mode.
Sourcepub fn ignore_whitespace(self, yes: bool) -> Self
pub fn ignore_whitespace(self, yes: bool) -> Self
set ignore-whitespace (verbose) mode.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EngineOptions
impl RefUnwindSafe for EngineOptions
impl Send for EngineOptions
impl Sync for EngineOptions
impl Unpin for EngineOptions
impl UnsafeUnpin for EngineOptions
impl UnwindSafe for EngineOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more