// Filename: internal/utils/validators.go
package utils

import "regexp"

const MaxGroupNameLength = 32

// groupNameRegex validates that a group name consists only of lowercase letters, numbers, and hyphens.
var groupNameRegex = regexp.MustCompile(`^[a-z0-9-]+$`)

// IsValidGroupName checks if the provided string is a valid group name.
func IsValidGroupName(name string) bool {
	if name == "" {
		return false
	}
	if len(name) > MaxGroupNameLength {
		return false
	}
	return groupNameRegex.MatchString(name)
}
