]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
tpl/strings: Clarify findRESubmatch description
authorJoe Mooring <joe.mooring@veriphor.com>
Tue, 18 Apr 2023 20:47:52 +0000 (13:47 -0700)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 27 Apr 2023 20:02:41 +0000 (22:02 +0200)
tpl/strings/regexp.go

index 84b015ffb31316638ce05a2a2385cedcfe043211..8d53b23b32e5e0e51e4e61fa0185e2999494da1b 100644 (file)
@@ -45,9 +45,14 @@ func (ns *Namespace) FindRE(expr string, content any, limit ...any) ([]string, e
        return re.FindAllString(conv, lim), nil
 }
 
-// FindRESubmatch returns returns a slice of strings holding the text of the leftmost match of the regular expression in s and the matches, if any, of its subexpressions.
+// FindRESubmatch returns a slice of all successive matches of the regular
+// expression in content. Each element is a slice of strings holding the text
+// of the leftmost match of the regular expression and the matches, if any, of
+// its subexpressions.
 //
-// By default all matches will be included. The number of matches can be limited with the optional limit parameter. A return value of nil indicates no match.
+// By default all matches will be included. The number of matches can be
+// limited with the optional limit parameter. A return value of nil indicates
+// no match.
 func (ns *Namespace) FindRESubmatch(expr string, content any, limit ...any) ([][]string, error) {
        re, err := reCache.Get(expr)
        if err != nil {