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.