IS_EMAIL_ADDRESS

Description

Returns TRUE if the string is formatted as a valid email address; otherwise, returns FALSE.

Syntax

IS_EMAIL_ADDRESS(string) -> Boolean

Parameters

ParameterData TypeRequiredDescription
stringStringYesThe string to evaluate.

Examples

IS_EMAIL_ADDRESS("user@example.com")
-- Returns TRUE.
IS_EMAIL_ADDRESS("user.example.com")
-- Returns FALSE, as it lacks the '@' symbol.
IS_EMAIL_ADDRESS("user@")
-- Returns FALSE, as it lacks a domain.

Tips

  • Returns FALSE if the string is empty.
  • The following regular expression is used to check whether the provided string is a valid email address:

    (?i)^(?=.{1,254}$)(?=.{1,64}@)(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x20\x21\x23-\x5b\x5d-\x7e]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|IPv6:[0-9a-f:.]+)\])$