From f0433cc339769be46ec0bd6f32d1d5a9d570d4b7 Mon Sep 17 00:00:00 2001 From: Jo Date: Tue, 21 Feb 2023 02:24:48 +0100 Subject: [PATCH] feat(metadata): respect regex in search (#1922) respect regex in search --- pkg/query/source.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/query/source.go b/pkg/query/source.go index 6ee66967..0dff1f70 100644 --- a/pkg/query/source.go +++ b/pkg/query/source.go @@ -5,6 +5,7 @@ import ( "io" "sort" "strings" + "unicode" "github.com/Jguer/aur" "github.com/Jguer/go-alpm/v2" @@ -168,9 +169,11 @@ func (s *SourceQueryBuilder) GetTargets(include, exclude intrange.IntRanges, // filter AUR results to remove strings that don't contain all of the search terms. func filterAURResults(pkgS []string, results []aur.Pkg) []aur.Pkg { aurPkgs := make([]aur.Pkg, 0, len(results)) - matchesSearchTerms := func(pkg *aur.Pkg, terms []string) bool { for _, pkgN := range terms { + if strings.IndexFunc(pkgN, unicode.IsSymbol) != -1 { + return true + } name := strings.ToLower(pkg.Name) desc := strings.ToLower(pkg.Description) targ := strings.ToLower(pkgN)