pub struct RegexSetMatch<'t, S: Input + ?Sized> { /* private fields */ }Expand description
A match from a RegexSet, including the pattern index and capture groups.
This type represents a single match found by a RegexSet. It provides
information about which pattern matched, the location of the match, and
access to any capture groups.
§Examples
use fancy_regex::{RegexInput, RegexSet};
let set = RegexSet::new(&[r"\w+"])?;
let mut matches = set
.find_input(RegexInput::new("abc"))?
.expect("expected at least one match");
let m = matches.next().expect("expected first match")?;
assert_eq!(m.pattern(), 0);
assert_eq!(m.get().as_str(), "abc");
assert_eq!(m.start(), 0);
assert_eq!(m.end(), 3);
assert_eq!(m.captures().len(), 1);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'t, S> Freeze for RegexSetMatch<'t, S>where
S: ?Sized,
impl<'t, S> RefUnwindSafe for RegexSetMatch<'t, S>where
S: RefUnwindSafe + ?Sized,
impl<'t, S> Send for RegexSetMatch<'t, S>
impl<'t, S> Sync for RegexSetMatch<'t, S>
impl<'t, S> Unpin for RegexSetMatch<'t, S>where
S: ?Sized,
impl<'t, S> UnsafeUnpin for RegexSetMatch<'t, S>where
S: ?Sized,
impl<'t, S> UnwindSafe for RegexSetMatch<'t, S>where
S: RefUnwindSafe + ?Sized,
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