pub struct RegexSetBuilder { /* private fields */ }Expand description
Compile a RegexSet with the flags spelled out.
The flags apply to every pattern in the set, as regex’s RegexSetBuilder
does it. (The C ABI underneath takes a flag word per pattern; nothing here
asks for that yet, and a knob with no caller is a knob that gets maintained
for nobody.)
let set = irgx::RegexSetBuilder::new(["café", "CIGAR"])
.ignore_case(true)
.build()?;
assert_eq!(set.matches("le CAFÉ noir").iter().collect::<Vec<_>>(), vec![0]);Implementations§
Source§impl RegexSetBuilder
impl RegexSetBuilder
Sourcepub fn new<I, S>(patterns: I) -> Self
pub fn new<I, S>(patterns: I) -> Self
A builder for patterns, with the same defaults as RegexSet::new.
Sourcepub fn fixed(&mut self, yes: bool) -> &mut Self
pub fn fixed(&mut self, yes: bool) -> &mut Self
Treat every pattern as a literal string rather than a regex.
Sourcepub fn ignore_case(&mut self, yes: bool) -> &mut Self
pub fn ignore_case(&mut self, yes: bool) -> &mut Self
Match without regard to case.
Sourcepub fn word(&mut self, yes: bool) -> &mut Self
pub fn word(&mut self, yes: bool) -> &mut Self
Report only matches whose edges are word boundaries.
Sourcepub fn smart_case(&mut self, yes: bool) -> &mut Self
pub fn smart_case(&mut self, yes: bool) -> &mut Self
Fold case only for the patterns that have no uppercase letter of their own. Resolved per pattern, at compile time.
Sourcepub fn unicode(&mut self, yes: bool) -> &mut Self
pub fn unicode(&mut self, yes: bool) -> &mut Self
Unicode-aware classes, folding, and boundaries. On by default.
Trait Implementations§
Source§impl Clone for RegexSetBuilder
impl Clone for RegexSetBuilder
Source§fn clone(&self) -> RegexSetBuilder
fn clone(&self) -> RegexSetBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RegexSetBuilder
impl RefUnwindSafe for RegexSetBuilder
impl Send for RegexSetBuilder
impl Sync for RegexSetBuilder
impl Unpin for RegexSetBuilder
impl UnsafeUnpin for RegexSetBuilder
impl UnwindSafe for RegexSetBuilder
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