MCPcopy Create free account
hub / github.com/bytebase/bytebase / ValidateEmail

Function ValidateEmail

backend/common/util.go:167–172  ·  view source on GitHub ↗

ValidateEmail validates the email address using WHATWG HTML spec. Only lowercase ASCII letters, digits, and standard email symbols are allowed.

(email string)

Source from the content-addressed store, hash-verified

165// ValidateEmail validates the email address using WHATWG HTML spec.
166// Only lowercase ASCII letters, digits, and standard email symbols are allowed.
167func ValidateEmail(email string) error {
168 if !emailRegex.MatchString(email) {
169 return errors.New("invalid email address")
170 }
171 return nil
172}
173
174// IsValidEmail returns true if the email is valid per WHATWG HTML spec.
175func IsValidEmail(email string) bool {

Callers 4

validateEmailWithDomainsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected