answer/pkg/checker/username.go

12 lines
192 B
Go

package checker
import "regexp"
var (
usernameReg = regexp.MustCompile(`^[a-z0-9._-]{4,30}$`)
)
func IsInvalidUsername(username string) bool {
return !usernameReg.MatchString(username)
}