]> Cypherpunks repositories - gostls13.git/commit
regexp: add Split
authorRick Arnold <rickarnoldjr@gmail.com>
Tue, 27 Nov 2012 17:58:27 +0000 (12:58 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 27 Nov 2012 17:58:27 +0000 (12:58 -0500)
commit94b3f6d728cf2e02c002c8f0a1b5296bb601322e
tree277d5aeeed5b14fe3035282e69818a174d6dfd54
parenta93b15cad90828a8706e79eb00e7962da09c1317
regexp: add Split

As discussed in issue 2672 and on golang-nuts, this CL adds a Split() method
to regexp. It is based on returning the "opposite" of FindAllString() so that
the returned substrings are everything not matched by the expression.

See: https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/xodBZh9Lh2E

Fixes #2762.

R=remyoudompheng, r, rsc
CC=golang-dev
https://golang.org/cl/6846048
src/pkg/regexp/all_test.go
src/pkg/regexp/regexp.go