diff --git a/object/check.go b/object/check.go index c01c9532..a0261b0b 100644 --- a/object/check.go +++ b/object/check.go @@ -322,11 +322,9 @@ func CheckUsername(name string) string { } // https://stackoverflow.com/questions/58726546/github-username-convention-using-regex - re, _ := regexp.Compile("^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$") + re, _ := regexp.Compile("^[a-zA-Z0-9]+((?:-[a-zA-Z0-9]+)|(?:_[a-zA-Z0-9]+))*$") if !re.MatchString(name) { - return fmt.Sprintf("The name '%s' may only contain alphanumeric characters or hyphens, "+ - "cannot have multiple consecutive hyphens, "+ - "and cannot begin or end with a hyphen.", name) + return "The username may only contain alphanumeric characters, underlines or hyphens, cannot have consecutive hyphens or underlines, and cannot begin or end with a hyphen or underline." } return ""