Skip to content

Commit

Permalink
MatchString
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Oct 3, 2021
1 parent ed8b77c commit c119023
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions std.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c119023

Please sign in to comment.