diff --git a/it/filter/filter.go b/it/filter/filter.go index af7ebb9..c2d6b06 100644 --- a/it/filter/filter.go +++ b/it/filter/filter.go @@ -99,6 +99,8 @@ func Or[T any](filters ...func(T) bool) func(T) bool { } } +// Match returns a function that returns true when the provided string or byte +// slice matches a pattern. See [regexp.MatchString]. func Match[T string | []byte](pattern *regexp.Regexp) func(T) bool { return func(term T) bool { return pattern.MatchString(string(term))