diff options
author | Joe Mooring <joe.mooring@veriphor.com> | 2023-04-18 13:47:52 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2023-04-27 22:02:41 +0200 |
commit | 5c7b79cf7f00aa2651dd5f0364ee575af6715a31 (patch) | |
tree | 7aabd6930e58a4bfc442d54a36d3b0562ed4f7a0 /tpl | |
parent | 0cb6ca59061eec19ad5117b540728d518caa360a (diff) |
tpl/strings: Clarify findRESubmatch description
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/strings/regexp.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tpl/strings/regexp.go b/tpl/strings/regexp.go index 84b015ffb..8d53b23b3 100644 --- a/tpl/strings/regexp.go +++ b/tpl/strings/regexp.go @@ -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 { |