diff options
Diffstat (limited to 're.go')
-rw-r--r-- | re.go | 23 |
1 files changed, 0 insertions, 23 deletions
@@ -1,23 +0,0 @@ -package main - -import ( - "regexp" - "strings" -) - -func re(s, r string) string { - // min: s// - if len(s) < 3 { - return "" - } - z := strings.Split(r[2:], string(r[1])) - // match s// and s/// - if len(z) < 2 || len(z) > 3 { - return "" - } - re, err := regexp.Compile(z[0]) - if err != nil { - return "" - } - return re.ReplaceAllString(s, z[1]) -} |