diff --git a/examples/regular-expressions/regular-expressions.go b/examples/regular-expressions/regular-expressions.go index a5a27e6..5eb8631 100644 --- a/examples/regular-expressions/regular-expressions.go +++ b/examples/regular-expressions/regular-expressions.go @@ -46,6 +46,11 @@ func main() { // example to find all matches for a regexp. fmt.Println(r.FindAllString("peach punch pinch", -1)) + // These `All` variants are available for the other + // functions we saw above as well. + fmt.Println(r.FindAllStringSubmatchIndex( + "peach punch pinch", -1)) + // Providing a non-negative integer as the second // argument to these functions will limit the number // of matches. diff --git a/examples/regular-expressions/regular-expressions.sh b/examples/regular-expressions/regular-expressions.sh index 69f689c..1f3882c 100644 --- a/examples/regular-expressions/regular-expressions.sh +++ b/examples/regular-expressions/regular-expressions.sh @@ -6,6 +6,7 @@ peach [peach ea] [0 5 1 3] [peach punch pinch] +[[0 5 1 3] [6 11 7 9] [12 17 13 15]] [peach punch] true p([a-z]+)ch