revert file

This commit is contained in:
huangqian
2021-12-22 20:23:24 +08:00
parent 8de8a0c97a
commit 739490c62b

View File

@ -138,3 +138,12 @@ func ReplaceStringFuncMatch(pattern string, src string, replaceFunc func(match [
return "", err
}
}
// Split slices `src` into substrings separated by the expression and returns a slice of
// the substrings between those expression matches.
func Split(pattern string, src string) []string {
if r, err := getRegexp(pattern); err == nil {
return r.Split(src, -1)
}
return nil
}