This commit is contained in:
2026-03-07 05:30:18 +07:00
parent 186d09ba5a
commit 3612805009
4 changed files with 112 additions and 66 deletions
+9 -1
View File
@@ -1,6 +1,9 @@
package cleaner
import "strings"
import (
"regexp"
"strings"
)
var (
replaceMap = map[string]string{
@@ -18,6 +21,7 @@ var (
"b": "в",
"u": "и",
}
re = regexp.MustCompile(`\(\[[a-zA-Zа-яА-Я\d-]+\]\)`)
)
type service struct{}
@@ -39,3 +43,7 @@ func (s *service) ClearCode(code string) string {
}
return code
}
func (s *service) ClearText(text string) string {
return re.ReplaceAllString(text, "")
}