3 Commits

Author SHA1 Message Date
09acd79fe8 remove regex lookaround 2022-01-15 19:57:38 +01:00
0f1586393b fix regex 2022-01-15 19:54:59 +01:00
0d49b3e716 fix regex 2022-01-15 19:39:51 +01:00

View File

@ -259,7 +259,7 @@ func (c *Config) Status() (ok bool) {
}
func cleanKey(key string) string {
expr := regexp.MustCompile("_+")
expr := regexp.MustCompile("__+")
fn := func(r rune) rune {
if (r >= '0' && r <= '9') || (r >= 'A' && r <= 'Z') || r == '_' {
return r
@ -267,7 +267,7 @@ func cleanKey(key string) string {
return -1
}
key = strings.Map(fn, strings.ToUpper(key))
key = strings.Trim(strings.Map(fn, strings.ToUpper(key)), "_")
return expr.ReplaceAllString(key, "_")
}