Is this Email Address Valid? quiz

Loading quiz...

Never Miss a Quiz!

Get new programming challenges delivered weekly.

TL;DR answer sheet

Is this Email Address Valid? — quiz answer sheet, click to expand.

1. What is the correct format of an email address with the correct terminology?

Answer: local-part@domain

Explanation: “local-part@domain” is the precise terminology from RFC 5321, where the local-part is the identifier for the mailbox and the domain specifies the mail server.

2. The local-part of an email address is case-sensitive, while the domain part is not.

Answer: true

Explanation: According to RFC 5321, the local-part (before the @) is case-sensitive, but in practice, most email services treat it as case-insensitive. The domain part is always case-insensitive.

3. Is this email address Valid: [email protected]

Answer: true

Explanation: This is a feature called sub-addressing (or plus addressing). Many email services will deliver this to '[email protected]' and you can use the full address to filter emails.

4. Is this email address Valid: user@localhost

Answer: true

Explanation: 'localhost' is a valid hostname, and emails can be sent to users on the local machine.

5. Is this email address Valid: john [email protected]

Answer: false

Explanation: Unquoted spaces are not allowed in the local-part of an email address. To be valid, it should be quoted like "john doe"@example.com.

6. Is this email address Valid: " "@example.com

Answer: true

Explanation: The local-part can be a quoted string, which can contain spaces.

7. Is this email address Valid: mr/[email protected]

Answer: true

Explanation: A forward slash '/' is a valid character in the local-part of an email address.

8. Is this email address Valid: #!/$%&'*+-/=?^_`{|}[email protected]

Answer: true

Explanation: Many special characters are allowed in the local-part of an email address, but some email providers may restrict their use.

9. Is this email address Valid: [email protected]

Answer: false

Explanation: The local-part of an email address cannot have two consecutive dots.

10. Is this email address Valid: "john <...>[] doe"@example.com

Answer: true

Explanation: When the local-part is a quoted string, it can contain a wide range of special characters, and supports consecutive dots.

11. How many @ symbols are allowed in a valid email address?

Answer: Multiple as long as they are in quotes

Explanation: Only one unquoted @ symbol is allowed in an email address. However, if the local-part is a quoted string, it can contain multiple @ symbols.

12. Is this email address Valid: first"and"[email protected]

Answer: false

Explanation: While you can have quotes in the local-part, they must be used to enclose the entire local-part (e.g., "first and second"@example.com) or be escaped with a backslash.

13. Is this email address Valid: idriss(What is this)@douiri.org

Answer: true

Explanation: Parentheses denote a comment, which is valid in an email address but is usually ignored by the mail server. The actual address is '[email protected]'.

14. Is this email address Valid: user@domain_name.com

Answer: false

Explanation: Underscores '_' are not allowed in domain names (hostnames). They are, however, allowed in the local-part.

15. Is this email address Valid: user@[127.0.0.1]

Answer: true

Explanation: IP address in square brackets are valid as the domain part, with a different syntax for IPv6 (user@[IPv6:::1).

16. Is this email address Valid: こんにちは@example.com

Answer: true

Explanation: This is an internationalized email address. according to RFC 6531 The local-part can contain UTF-8 characters. The domain part would be converted to Punycode to be compatible with DNS.

17. Is this email address Valid: ❤️@example.com

Answer: true

Explanation: The local-part of an email address can include Unicode characters, including emojis. (RFC 6531)