Change-Id: I016312f3ecf3dfcbf0eaf24e31b6842d80abb029
GitHub-Last-Rev:
360047c9006dba643429c006f89d813d927999b3
GitHub-Pull-Request: golang/go#30445
Reviewed-on: https://go-review.googlesource.com/c/164257
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
import (
"fmt"
"regexp"
+ "strings"
)
func Example() {
// -W-xxW-
}
+func ExampleRegexp_ReplaceAllStringFunc() {
+ re := regexp.MustCompile(`[^aeiou]`)
+ fmt.Println(re.ReplaceAllStringFunc("seafood fool", strings.ToUpper))
+ // Output:
+ // SeaFooD FooL
+}
+
func ExampleRegexp_SubexpNames() {
re := regexp.MustCompile(`(?P<first>[a-zA-Z]+) (?P<last>[a-zA-Z]+)`)
fmt.Println(re.MatchString("Alan Turing"))