regexp: change Expr() to String(); add HasOperator method to Regexp.
It reports whether a regular expression has operators
as opposed to matching literal text.
R=rsc, gri
CC=golang-dev
https://golang.org/cl/3731041
diff --git a/src/pkg/regexp/find_test.go b/src/pkg/regexp/find_test.go
index 27c5a54..34a7986 100644
--- a/src/pkg/regexp/find_test.go
+++ b/src/pkg/regexp/find_test.go
@@ -120,8 +120,8 @@
func TestFind(t *testing.T) {
for _, test := range findTests {
re := MustCompile(test.pat)
- if re.Expr() != test.pat {
- t.Errorf("Expr() = `%s`; should be `%s`", re.Expr(), test.pat)
+ if re.String() != test.pat {
+ t.Errorf("String() = `%s`; should be `%s`", re.String(), test.pat)
}
result := re.Find([]byte(test.text))
switch {