Skip to content

Commit

Permalink
revert file
Browse files Browse the repository at this point in the history
  • Loading branch information
huangqian1985 committed Dec 22, 2021
1 parent 8de8a0c commit 739490c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions text/gregex/gregex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 739490c

Please sign in to comment.