From c11902305616a288d0622c7f417ee3e2f4d030cb Mon Sep 17 00:00:00 2001 From: Joseph Kato Date: Sat, 2 Oct 2021 17:08:13 -0700 Subject: [PATCH] MatchString --- std.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/std.go b/std.go index f9ebfdf..9c5bcd1 100644 --- a/std.go +++ b/std.go @@ -12,6 +12,14 @@ func MustCompileStd(s string) *Regexp { return re } +func MatchString(pattern, s string) (bool, error) { + re, err := CompileStd(pattern) + if err != nil { + return false, err + } + return re.MatchStringStd(s), nil +} + func (re *Regexp) MatchStringStd(s string) bool { match, err := re.MatchString(s) if err != nil {