pub struct RegexBuilder { /* private fields */ }Expand description
Options for compiling a regex. By default, matching operates on bytes with ASCII character classes and case-sensitive matching.
Implementations§
Source§impl RegexBuilder
impl RegexBuilder
Sourcepub fn build(&self, pattern: &str) -> Result<Regex, Error>
pub fn build(&self, pattern: &str) -> Result<Regex, Error>
Compiles a pattern. Literal NUL bytes must be written as \x00 escapes.
Sourcepub fn multi_line(&mut self, yes: bool) -> &mut Self
pub fn multi_line(&mut self, yes: bool) -> &mut Self
Allows ^ and $ to match line boundaries inside the input.
Sourcepub fn utf(&mut self, yes: bool) -> &mut Self
pub fn utf(&mut self, yes: bool) -> &mut Self
Decodes UTF-8 instead of matching individual bytes. Offsets remain bytes.
Sourcepub fn ucp(&mut self, yes: bool) -> &mut Self
pub fn ucp(&mut self, yes: bool) -> &mut Self
Uses Unicode properties for \d, \w, \s, and word boundaries.
This is independent of UTF-8 decoding and case folding.
Sourcepub fn unicode_case(&mut self, yes: bool) -> &mut Self
pub fn unicode_case(&mut self, yes: bool) -> &mut Self
Enables Unicode case folding when case-insensitive matching is enabled.
Sourcepub fn ungreedy(&mut self, yes: bool) -> &mut Self
pub fn ungreedy(&mut self, yes: bool) -> &mut Self
Reverses the default greediness of quantifiers.
Trait Implementations§
Source§impl Clone for RegexBuilder
impl Clone for RegexBuilder
Source§fn clone(&self) -> RegexBuilder
fn clone(&self) -> RegexBuilder
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 moreSource§impl Debug for RegexBuilder
impl Debug for RegexBuilder
Source§impl Default for RegexBuilder
impl Default for RegexBuilder
Source§fn default() -> RegexBuilder
fn default() -> RegexBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RegexBuilder
impl RefUnwindSafe for RegexBuilder
impl Send for RegexBuilder
impl Sync for RegexBuilder
impl Unpin for RegexBuilder
impl UnsafeUnpin for RegexBuilder
impl UnwindSafe for RegexBuilder
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