File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -482,6 +482,24 @@ impl SetMatches {
482482 !self . 0 . is_empty ( )
483483 }
484484
485+ /// Whether all patterns in this set matched.
486+ ///
487+ /// # Example
488+ ///
489+ /// ```
490+ /// use regex::bytes::RegexSet;
491+ ///
492+ /// let set = RegexSet::new(&[
493+ /// r"^foo",
494+ /// r"[a-z]+\.com",
495+ /// ]).unwrap();
496+ /// let matches = set.matches(b"foo.example.com");
497+ /// assert!(matches.matched_all());
498+ /// ```
499+ pub fn matched_all ( & self ) -> bool {
500+ self . 0 . is_full ( )
501+ }
502+
485503 /// Whether the regex at the given index matched.
486504 ///
487505 /// The index for a regex is determined by its insertion order upon the
Original file line number Diff line number Diff line change @@ -478,6 +478,24 @@ impl SetMatches {
478478 !self . 0 . is_empty ( )
479479 }
480480
481+ /// Whether all patterns in this set matched.
482+ ///
483+ /// # Example
484+ ///
485+ /// ```
486+ /// use regex::RegexSet;
487+ ///
488+ /// let set = RegexSet::new(&[
489+ /// r"^foo",
490+ /// r"[a-z]+\.com",
491+ /// ]).unwrap();
492+ /// let matches = set.matches("foo.example.com");
493+ /// assert!(matches.matched_all());
494+ /// ```
495+ pub fn matched_all ( & self ) -> bool {
496+ self . 0 . is_full ( )
497+ }
498+
481499 /// Whether the regex at the given index matched.
482500 ///
483501 /// The index for a regex is determined by its insertion order upon the
You can’t perform that action at this time.
0 commit comments