Struct SetMatchesIntoIter
pub struct SetMatchesIntoIter { /* private fields */ }
An owned iterator over the set of matches from a regex set.
This will always produces matches in ascending order of index, where the index corresponds to the index of the regex that matched with respect to its position when initially building the set.
This iterator is created by calling SetMatches::into_iter via the
IntoIterator trait. This is automatically done in for loops.
Example
use regex::RegexSet;
let set = RegexSet::new([
r"[0-9]",
r"[a-z]",
r"[A-Z]",
r"\p{Greek}",
]).unwrap();
let hay = "βa1";
let mut matches = vec![];
for index in set.matches(hay) {
matches.push(index);
}
assert_eq!(matches, vec![0, 1, 3]);
Trait Implementations
impl Debug for SetMatchesIntoIter
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl DoubleEndedIterator for SetMatchesIntoIter
fn next_back(&mut self) -> Option<usize>
impl FusedIterator for SetMatchesIntoIter
impl Iterator for SetMatchesIntoIter
type Item = usize;fn next(&mut self) -> Option<usize>fn size_hint(&self) -> (usize, Option<usize>)