mirror of
https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git
synced 2024-11-14 14:08:12 +00:00
35 lines
779 B
Go
35 lines
779 B
Go
package sprig
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
func regexMatch(regex string, s string) bool {
|
|
match, _ := regexp.MatchString(regex, s)
|
|
return match
|
|
}
|
|
|
|
func regexFindAll(regex string, s string, n int) []string {
|
|
r := regexp.MustCompile(regex)
|
|
return r.FindAllString(s, n)
|
|
}
|
|
|
|
func regexFind(regex string, s string) string {
|
|
r := regexp.MustCompile(regex)
|
|
return r.FindString(s)
|
|
}
|
|
|
|
func regexReplaceAll(regex string, s string, repl string) string {
|
|
r := regexp.MustCompile(regex)
|
|
return r.ReplaceAllString(s, repl)
|
|
}
|
|
|
|
func regexReplaceAllLiteral(regex string, s string, repl string) string {
|
|
r := regexp.MustCompile(regex)
|
|
return r.ReplaceAllLiteralString(s, repl)
|
|
}
|
|
|
|
func regexSplit(regex string, s string, n int) []string {
|
|
r := regexp.MustCompile(regex)
|
|
return r.Split(s, n)
|
|
}
|