Commit 6bfd2d19 authored by Ivan Moscoso's avatar Ivan Moscoso Committed by Ian Lance Taylor

regexp: clarify example for 'FindString'

Clarifying that FindString only provides left-most match

Change-Id: Ic6ecec12cca759fd4b3565ef5901a110843ffd56
Reviewed-on: https://go-review.googlesource.com/48609Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 9c5eadf4
......@@ -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"
// ""
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment