From c88ebd1aa50fe0395cb5a5afa68d10c48fe6ec4f Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Sat, 1 Feb 2025 18:05:55 -0500 Subject: [PATCH] Added comments explaining what a Match is --- regex/matching.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/regex/matching.go b/regex/matching.go index 975f228..71819e5 100644 --- a/regex/matching.go +++ b/regex/matching.go @@ -5,7 +5,12 @@ import ( "sort" ) -// a Match stores a slice of all the capturing groups in a match. +// A Match represents a match found by the regex in a given string. +// It is represented as a list of [Group]s, where the nth element contains +// the indices matched by the nth capturing group. The element at index 0 is known +// as the 0-group, and represents the contents of the entire match. +// +// See [Regex.FindSubmatch] for an example. type Match []Group // a Group represents a group. It contains the start index and end index of the match