This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package configutils
import (
"regexp"
"strings"
)
var whitespaceReg = regexp.MustCompile(`\s+`)
// MatchKeyword 关键词匹配
func MatchKeyword(source, keyword string) bool {
if len(keyword) == 0 {
return false
}
pieces := whitespaceReg.Split(keyword, -1)
source = strings.ToLower(source)
for _, piece := range pieces {
if strings.Contains(source, strings.ToLower(piece)) {
return true
}
}
return false
}