Lines Matching refs:matches

19 /// constituent regular expressions matches. A regex set as its formulated here
88 /// let matches: Vec<&str> = set.matches(text).into_iter()
99 /// assert_eq!(vec!["foo", "bar"], matches);
144 /// Returns true if and only if one of the regexes in this set matches
151 /// find all matches.
160 /// Tests whether a set matches some text:
186 /// matches in the given text. The index is in correspondence with the
211 /// let matches: Vec<_> = set.matches("foobar").into_iter().collect();
212 /// assert_eq!(matches, vec![0, 2, 3, 4, 6]);
215 /// let matches = set.matches("foobar");
216 /// assert!(!matches.matched(5));
217 /// assert!(matches.matched(6));
219 pub fn matches(&self, text: $text_ty) -> SetMatches {
220 let mut matches = vec![false; self.0.regex_strings().len()];
221 let any = self.read_matches_at(&mut matches, text, 0);
224 matches: matches,
228 /// Returns the same as matches, but starts the search at the given
229 /// offset and stores the matches into the slice given.
235 /// `matches` must have a length that is at least the number of regexes
239 /// `matches` is true after executing the set against `text`.
243 matches: &mut [bool],
247 self.0.searcher().many_matches_at(matches, $as_bytes(text), start)
280 /// let matches: Vec<_> = set
281 /// .matches("foobar")
285 /// assert_eq!(matches, vec![r"\w+", r"\pL+", r"foo", r"bar", r"foobar"]);
292 /// A set of matches returned by a regex set.
296 matches: Vec<bool>,
300 /// Whether this set contains any matches.
314 self.matches[regex_index]
317 /// The total number of regexes in the set that created these matches.
319 self.matches.len()
324 /// This will always produces matches in ascending order of index, where
328 SetMatchesIter((&*self.matches).into_iter().enumerate())
337 SetMatchesIntoIter(self.matches.into_iter().enumerate())
350 /// An owned iterator over the set of matches from a regex set.
352 /// This will always produces matches in ascending order of index, where the
390 /// A borrowed iterator over the set of matches from a regex set.
394 /// This will always produces matches in ascending order of index, where the
467 /// let matches: Vec<_> = set.matches("foo@example.com").into_iter().collect();
468 /// assert_eq!(vec![0, 1], matches);
470 /// // Try again, but with text that only matches one of the regexes.
471 /// let matches: Vec<_> = set.matches("example.com").into_iter().collect();
472 /// assert_eq!(vec![1], matches);
475 /// let matches: Vec<_> = set.matches("example").into_iter().collect();
476 /// assert!(matches.is_empty());
496 /// let matches: Vec<_> = set.matches(b"foo@example.com").into_iter().collect();
497 /// assert_eq!(vec![0, 1], matches);
499 /// // Try again, but with text that only matches one of the regexes.
500 /// let matches: Vec<_> = set.matches(b"example.com").into_iter().collect();
501 /// assert_eq!(vec![1], matches);
504 /// let matches: Vec<_> = set.matches(b"example").into_iter().collect();
505 /// assert!(matches.is_empty());