i forgot something

This commit is contained in:
2025-12-24 02:28:26 +03:00
parent baf5e9d0cd
commit 227e2aae51
2 changed files with 66 additions and 0 deletions

24
util.go Normal file
View File

@@ -0,0 +1,24 @@
package parser
import (
"fmt"
"regexp"
"strings"
)
func containsWord(s, substr string) (match bool) {
var err error
for _, field := range strings.Fields(s) {
match, err = regexp.MatchString(
fmt.Sprintf("^%s$", substr),
field,
)
if err != nil {
println(err)
}
if match {
return
}
}
return
}