summaryrefslogtreecommitdiff
path: root/regexp/regexp.go
blob: 8aeaa43c42842ffa615c094540d777539aec6309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package regexp

import stdre "regexp"

// Replace -
func Replace(expression, replacement, input string) string {
	re := stdre.MustCompile(expression)
	return re.ReplaceAllString(input, replacement)
}

// Match -
func Match(expression, input string) bool {
	re := stdre.MustCompile(expression)
	return re.MatchString(input)
}