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.
Sourcepub fn anchored(&mut self, yes: bool) -> &mut Self
pub fn anchored(&mut self, yes: bool) -> &mut Self
Requires matches to start at the beginning of the input.
Sourcepub fn glob(&mut self, yes: bool) -> &mut Self
pub fn glob(&mut self, yes: bool) -> &mut Self
Parses the pattern using JavelinPattern’s glob syntax.
Sourcepub fn prefer_backtracking(&mut self, yes: bool) -> &mut Self
pub fn prefer_backtracking(&mut self, yes: bool) -> &mut Self
Prefers the backtracking processor over automatic processor selection.
Sourcepub fn auto_cluster(&mut self, yes: bool) -> &mut Self
pub fn auto_cluster(&mut self, yes: bool) -> &mut Self
Replaces unused captures with non-capturing groups. Captures needed by backreferences and recursion are retained. This can change capture counts and numbering; leave it disabled when extracting capture groups.
Trait Implementations§
Source§impl Clone for RegexBuilder
impl Clone for RegexBuilder
Source§fn clone(&self) -> RegexBuilder
fn clone(&self) -> RegexBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more