pub struct RegexSet { /* private fields */ }Expand description
A multi-pattern set: which patterns match the subject at least once (which-matched).
Mirrors the regex crate’s RegexSet. Bitset order is the
construction order of the patterns. Captures are not reported — re-run the individual
pattern if groups are needed. Stage-1 is N independent walks with per-pattern early-exit
(not a fused single-pass automaton).
Implementations§
Source§impl RegexSet
impl RegexSet
Sourcepub fn new<I, S>(patterns: I) -> Result<RegexSet, Error>
pub fn new<I, S>(patterns: I) -> Result<RegexSet, Error>
Compile every pattern; fails if any pattern is invalid (no silent skip).
Sourcepub fn with_flags<I, S>(patterns: I, flags: u32) -> Result<RegexSet, Error>
pub fn with_flags<I, S>(patterns: I, flags: u32) -> Result<RegexSet, Error>
Compile with a real::flags bitmask (same bits as Regex::with_flags).
Sourcepub fn is_match(&self, text: &str) -> bool
pub fn is_match(&self, text: &str) -> bool
True if any pattern matches text (stops at the first hit).
Sourcepub fn matches(&self, text: &str) -> Vec<bool>
pub fn matches(&self, text: &str) -> Vec<bool>
Which patterns match at least once: bitset of length len,
construction order. Index i is true iff pattern i matched.
Sourcepub fn matched_ids(&self, text: &str) -> Vec<usize>
pub fn matched_ids(&self, text: &str) -> Vec<usize>
Indices of matching patterns (ascending, construction order).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RegexSet
impl RefUnwindSafe for RegexSet
impl Unpin for RegexSet
impl UnsafeUnpin for RegexSet
impl UnwindSafe for RegexSet
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