aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Moscoso <moscoso@gmail.com>2017-07-15 11:53:48 -0600
committerIan Lance Taylor <iant@golang.org>2017-07-15 20:38:58 +0000
commit6bfd2d19ffa5b9700e1ddc8744bdfedf40d2b705 (patch)
tree73273927a48810b617fa434085adfcd2913152f6 /src
parent9c5eadf41379b53db38787e70012eeb2de8f41c9 (diff)
downloadgo-6bfd2d19ffa5b9700e1ddc8744bdfedf40d2b705.tar.xz
regexp: clarify example for 'FindString'
Clarifying that FindString only provides left-most match Change-Id: Ic6ecec12cca759fd4b3565ef5901a110843ffd56 Reviewed-on: https://go-review.googlesource.com/48609 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/regexp/example_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regexp/example_test.go b/src/regexp/example_test.go
index d05e87b0db..8661d6d389 100644
--- a/src/regexp/example_test.go
+++ b/src/regexp/example_test.go
@@ -39,11 +39,11 @@ func ExampleMatchString() {
}
func ExampleRegexp_FindString() {
- re := regexp.MustCompile("fo.?")
- fmt.Printf("%q\n", re.FindString("seafood"))
+ re := regexp.MustCompile("foo.?")
+ fmt.Printf("%q\n", re.FindString("seafood fool"))
fmt.Printf("%q\n", re.FindString("meat"))
// Output:
- // "foo"
+ // "food"
// ""
}