regex

These routines take an extra integer argument, n; if n >= 0, the function returns at most n matches/submatches.

0
-1

例子:

re := regexp.MustCompile("[0-9]+")
fmt.Println(re.FindAllString("abc123def987asdf", -1))

输出:

[123 987]

在Go Playground号公路上试试吧.