Skip to content

Commit

Permalink
tpl/strings: Clarify findRESubmatch description
Browse files Browse the repository at this point in the history
  • Loading branch information
jmooring committed Apr 18, 2023
1 parent 46a3cf6 commit 6ac9a2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tpl/strings/regexp.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ 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 strings holding the text of the leftmost
// match of the regular expression in content 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 {
Expand Down

0 comments on commit 6ac9a2e

Please sign in to comment.