pub struct Pattern { /* private fields */ }
Expand description
The Pattern
represents a compiled regex, ready to be matched against arbitrary text.
Implementations§
Source§impl Pattern
impl Pattern
Sourcepub fn match_against<'a>(&'a self, text: &'a str) -> Option<Matches<'a>>
pub fn match_against<'a>(&'a self, text: &'a str) -> Option<Matches<'a>>
Matches this compiled Pattern
against the text and returns the matches.
Sourcepub fn capture_names(&self) -> impl Iterator<Item = &str>
pub fn capture_names(&self) -> impl Iterator<Item = &str>
Returns all names this Pattern
captures.
Sourcepub fn get_extract(&self, name: &str) -> Option<&str>
pub fn get_extract(&self, name: &str) -> Option<&str>
Returns the extract for the given name.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pattern
impl RefUnwindSafe for Pattern
impl Send for Pattern
impl Sync for Pattern
impl Unpin for Pattern
impl UnwindSafe for Pattern
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