add lazy quantifier to prefixregex (#2466)

This commit is contained in:
Zachary Rice 2024-02-15 17:08:27 -06:00 committed by GitHub
parent 40bbab8add
commit 834163acf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -159,7 +159,7 @@ func CleanResults(results []Result) []Result {
func PrefixRegex(keywords []string) string {
pre := `(?i)(?:`
middle := strings.Join(keywords, "|")
post := `)(?:.|[\n\r]){0,40}`
post := `)(?:.|[\n\r]){0,40}?`
return pre + middle + post
}