]> Cypherpunks repositories - gostls13.git/commitdiff
regexp: fix glitch in doc for FindReaderIndex
authorRob Pike <r@golang.org>
Mon, 30 Jul 2012 19:46:50 +0000 (12:46 -0700)
committerRob Pike <r@golang.org>
Mon, 30 Jul 2012 19:46:50 +0000 (12:46 -0700)
Fixes #3878.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6457054

src/pkg/regexp/regexp.go

index 4b329e9cccfd35275094259e79f376c3d3ae3cd1..e4896a1c0503ed7ea9e30f53c7dc0ccb01c0d21a 100644 (file)
@@ -686,8 +686,9 @@ func (re *Regexp) FindStringIndex(s string) (loc []int) {
 
 // FindReaderIndex returns a two-element slice of integers defining the
 // location of the leftmost match of the regular expression in text read from
-// the RuneReader.  The match itself is at s[loc[0]:loc[1]].  A return
-// value of nil indicates no match.
+// the RuneReader.  The match text was found in the input stream at
+// byte offset loc[0] through loc[1]-1.
+// A return value of nil indicates no match.
 func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int) {
        a := re.doExecute(r, nil, "", 0, 2)
        if a == nil {