diff options
author | Rob Pike <r@golang.org> | 2010-09-21 21:21:44 +1000 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2010-09-21 21:21:44 +1000 |
commit | fef0341d629ada07c60d95a42a53b338f73896af (patch) | |
tree | 4ad928df79168b6ffa30dbd7c759b714863ecc2b | |
parent | 530fc540c1d2bc9e888f391a9030bf373876adcc (diff) | |
download | go-fef0341d629ada07c60d95a42a53b338f73896af.tar.gz |
regexp: delete Iter methods
They are unused and not that useful anyway.
R=rsc
CC=golang-dev
http://codereview.appspot.com/2225045
-rw-r--r-- | src/pkg/regexp/regexp.go | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/pkg/regexp/regexp.go b/src/pkg/regexp/regexp.go index f3e07d74a..488b02333 100644 --- a/src/pkg/regexp/regexp.go +++ b/src/pkg/regexp/regexp.go @@ -1149,42 +1149,6 @@ func (re *Regexp) allMatches(s string, b []byte, n int, deliver func([]int)) { } } -// TODO: AllMatchesIter and AllMatchesStringIter should change to return submatches as well. - -// AllMatchesIter slices the byte slice b into substrings that are successive -// matches of the Regexp within b. If n > 0, the function returns at most n -// matches. Text that does not match the expression will be skipped. Empty -// matches abutting a preceding match are ignored. The function returns a -// channel that iterates over the matching substrings. -func (re *Regexp) AllMatchesIter(b []byte, n int) <-chan []byte { - if n <= 0 { - n = len(b) + 1 - } - c := make(chan []byte, 10) - go func() { - re.allMatches("", b, n, func(match []int) { c <- b[match[0]:match[1]] }) - close(c) - }() - return c -} - -// AllMatchesStringIter slices the string s into substrings that are successive -// matches of the Regexp within s. If n > 0, the function returns at most n -// matches. Text that does not match the expression will be skipped. Empty -// matches abutting a preceding match are ignored. The function returns a -// channel that iterates over the matching substrings. -func (re *Regexp) AllMatchesStringIter(s string, n int) <-chan string { - if n <= 0 { - n = len(s) + 1 - } - c := make(chan string, 10) - go func() { - re.allMatches(s, nil, n, func(match []int) { c <- s[match[0]:match[1]] }) - close(c) - }() - return c -} - // Find returns a slice holding the text of the leftmost match in b of the regular expression. // A return value of nil indicates no match. func (re *Regexp) Find(b []byte) []byte { |