Files
diun/internal/utl/utl.go
2019-06-04 22:11:54 +02:00

16 lines
265 B
Go

package utl
import (
"regexp"
)
// MatchString reports whether a string s
// contains any match of a regular expression.
func MatchString(exp string, s string) bool {
re, err := regexp.Compile(exp)
if err != nil {
return false
}
return re.MatchString(s)
}