In this method:
func (re *Regexp) FindAllStringSubmatch(s string, n int) [][]string
What does the second parameter do? I have tried:
re, _ := regexp.Compile("a")
rs := re.FindAllString("aaaaa, ", **1**) // 1 get one 'a', 2 get two 'a's, 3 get three 'a's ...
for _,v := range rs {
fmt.Println(v)
}
It seems that the second parameter is about how many times it matches. Am I right? Could anybody give me an answer for sure? Official doc or some links is prefer.
Citation from the overview section of http://golang.org/pkg/regexp/:
If 'All' is present, the routine matches successive non-overlapping matches of the entire expression. Empty matches abutting a preceding match are ignored. The return value is a slice containing the successive return values of the corresponding non-'All' routine. These routines take an extra integer argument, n; if n >= 0, the function returns at most n matches/submatches.