lookienergy.blogg.se

Email regex
Email regex










email regex

Bracketed domains must start with, and must not contain characters 9 (TAB), 10 (LF), 13 (CR), 32 (space), 91-94 (, ^).

email regex

A label must not start nor end with a hyphen.

  • A label may contain hyphens, but no two hyphens in a row.
  • The maximum length of a label is 63 characters.
  • No two periods in succession can be in a domain name. No period can start or end a domain name.
  • A plain domain consists of labels separated with periods.
  • If an email is using the obsolete quoting on a per-label basis, then the email address consists of unquoted or quoted chunks separated by periods.
  • This supersedes the previous rule, allowing spaces and quotation marks in the email address as long as they are escaped.
  • If the quoted local part has a backslash, the following character is escaped and must not be 10 (LF), 13 (CR).
  • The contents of a quoted local part can not contain characters 9 (TAB), 10 (LF), 13 (CR), 32 (space), 34 (“), 91-94 (, ^).
  • The quoted local part starts with a quotation mark, ends with a quotation mark.
  • TEXT can contain alphabetic, numeric, and these symbols: !#$%’*+-/=?^_`~ ( RFC 2822, section 3.4.1).
  • No periods can start or end the local part.
  • Unquoted local parts can consist of TEXT, optionally separated by periods.
  • The local part can be unquoted, quoted in its entirety, or quoted on a per-label basis.
  • Email addresses consist of a local part, the symbol, and the domain.
  • All email addresses are in 7-bit US ASCII.
  • The summary is based largely on RFC 2822.

    email regex

    Here’s a list of the principal RFC texts about email addresses and the SMTP standard:












    Email regex