common/identity/alias.go

16 lines
265 B
Go
Raw Normal View History

2025-01-12 09:17:29 +01:00
package identity
import (
"regexp"
)
const (
2025-01-21 11:15:53 +01:00
aliasRegex = `^[a-zA-Z0-9]+(\.[a-zA-Z0.9]+)*$`
2025-01-12 09:17:29 +01:00
)
// IsValidAlias checks if the alias is a valid alias format
func IsValidAlias(alias string) bool {
match, _ := regexp.MatchString(aliasRegex, alias)
return match
}