diff --git a/regex/matching.go b/regex/matching.go index fd17ea7..1951484 100644 --- a/regex/matching.go +++ b/regex/matching.go @@ -148,7 +148,7 @@ func pruneIndices(indices []Match) []Match { func (regex Reg) Find(str string) (Group, error) { match, err := regex.FindNthMatch(str, 1) if err != nil { - return Group{}, nil + return Group{}, fmt.Errorf("no matches found") } return getZeroGroup(match), nil }