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) }