diff --git a/regex/matching.go b/regex/matching.go index b82a60f..f6f73b5 100644 --- a/regex/matching.go +++ b/regex/matching.go @@ -142,7 +142,7 @@ func pruneIndices(indices []Match) []Match { // the regex, in the given string. The return value will be an empty string in two situations: // 1. No match was found // 2. The match was an empty string -func FindString(regex Reg, str string) string { +func (regex Reg) FindString(str string) string { match, err := FindNthMatch(regex, str, 1) if err != nil { return "" diff --git a/regex/re_test.go b/regex/re_test.go index 80ba6e9..e319b0e 100644 --- a/regex/re_test.go +++ b/regex/re_test.go @@ -704,7 +704,7 @@ func TestFindString(t *testing.T) { panic(err) } } else { - foundString := FindString(regComp, test.str) + foundString := regComp.FindString(test.str) if len(test.result) == 0 { if foundString != "" { t.Errorf("Expected no match got %v\n", foundString)