From 0d19664044be571786eea388677dee16dba5bd06 Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 30 Jan 2025 22:57:35 -0500 Subject: [PATCH] Cleared up some comments, wrote a skeleton for FindAllString --- regex/matching.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/regex/matching.go b/regex/matching.go index f6f73b5..0f4023b 100644 --- a/regex/matching.go +++ b/regex/matching.go @@ -138,8 +138,8 @@ func pruneIndices(indices []Match) []Match { return toRet } -// FindString returns a _string_ containing the _text_ of the _leftmost_ match of -// the regex, in the given string. The return value will be an empty string in two situations: +// FindString returns a string containing the text of the leftmost match of the regex in the given string. +// The return value will be an empty string in two situations: // 1. No match was found // 2. The match was an empty string func (regex Reg) FindString(str string) string { @@ -151,11 +151,11 @@ func (regex Reg) FindString(str string) string { } // FindAllString is the 'all' version of FindString. -// It returns a _slice of strings_ containing the _text_ of _all_ matches of -// the regex, in the given string. -//func FindAllString(regex Reg, str []string) []string { -// -//} +// It returns a slice of strings containing the text of all matches of +// the regex in the given string. +func FindAllString(regex Reg, str []string) []string { + return []string{} +} // FindNthMatch finds the 'n'th match of the regex represented by the given start-state, with // the given string.