diff --git a/src/pattern.go b/src/pattern.go index 35a2f33c..8029fd0c 100644 --- a/src/pattern.go +++ b/src/pattern.go @@ -175,7 +175,7 @@ func parseTerms(fuzzy bool, caseMode Case, normalize bool, str string) []termSet text = text[1:] } - if strings.HasSuffix(text, "$") { + if text != "$" && strings.HasSuffix(text, "$") { if strings.HasSuffix(text, "\\$") { text = text[:len(text)-2] + "$" } else { diff --git a/src/pattern_test.go b/src/pattern_test.go index efb1ef2d..7adc51db 100644 --- a/src/pattern_test.go +++ b/src/pattern_test.go @@ -58,7 +58,7 @@ func TestParseTermsExtendedExact(t *testing.T) { } func TestParseTermsEmpty(t *testing.T) { - terms := parseTerms(true, CaseSmart, false, "' $ ^ !' !^ !$") + terms := parseTerms(true, CaseSmart, false, "' ^ !' !^") if len(terms) != 0 { t.Errorf("%s", terms) }