diff --git a/src/regex/bytes.rs b/src/regex/bytes.rs index 19f5701af..fd36c8676 100644 --- a/src/regex/bytes.rs +++ b/src/regex/bytes.rs @@ -1568,10 +1568,15 @@ impl<'h> From> for core::ops::Range { /// Represents the capture groups for a single match. /// -/// Capture groups refer to parts of a regex enclosed in parentheses. They can -/// be optionally named. The purpose of capture groups is to be able to -/// reference different parts of a match based on the original pattern. For -/// example, say you want to match the individual letters in a 5-letter word: +/// Capture groups refer to parts of a regex enclosed in parentheses. They +/// can be optionally named. The purpose of capture groups is to be able to +/// reference different parts of a match based on the original pattern. In +/// essence, a `Captures` is a container of [`Match`] values for each group +/// that participated in a regex match. Each `Match` can be looked up by either +/// its capture group index or name (if it has one). +/// +/// For example, say you want to match the individual letters in a 5-letter +/// word: /// /// ```text /// (?\w)(\w)(?:\w)\w(?\w) diff --git a/src/regex/string.rs b/src/regex/string.rs index 880d6082a..25f43a7f3 100644 --- a/src/regex/string.rs +++ b/src/regex/string.rs @@ -1573,10 +1573,15 @@ impl<'h> From> for core::ops::Range { /// Represents the capture groups for a single match. /// -/// Capture groups refer to parts of a regex enclosed in parentheses. They can -/// be optionally named. The purpose of capture groups is to be able to -/// reference different parts of a match based on the original pattern. For -/// example, say you want to match the individual letters in a 5-letter word: +/// Capture groups refer to parts of a regex enclosed in parentheses. They +/// can be optionally named. The purpose of capture groups is to be able to +/// reference different parts of a match based on the original pattern. In +/// essence, a `Captures` is a container of [`Match`] values for each group +/// that participated in a regex match. Each `Match` can be looked up by either +/// its capture group index or name (if it has one). +/// +/// For example, say you want to match the individual letters in a 5-letter +/// word: /// /// ```text /// (?\w)(\w)(?:\w)\w(?\w)