Skip to main content
replaced http://tools.ietf.org/html/rfc with https://www.rfc-editor.org/rfc/rfc
Source Link

Write a function or program to validate an e-mail address against RFC 53215321 (some grammar rules found in 53225322) with the relaxation that you can ignore comments and folding whitespace (CFWS) and generalised address literals. This gives the grammar

Write a function or program to validate an e-mail address against RFC 5321 (some grammar rules found in 5322) with the relaxation that you can ignore comments and folding whitespace (CFWS) and generalised address literals. This gives the grammar

Write a function or program to validate an e-mail address against RFC 5321 (some grammar rules found in 5322) with the relaxation that you can ignore comments and folding whitespace (CFWS) and generalised address literals. This gives the grammar

edited tags
Link
user45941
user45941
Update a couple of test cases
Source Link
Peter Taylor
  • 43.4k
  • 4
  • 72
  • 179

Note: I've skipped the definition of IPv6-addr because this particular RFC gets it wrong and disallows e.g. ::1. The correct spec is in RFC 2373.

[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] email@[123.123.123.123] "email"@domain.com [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ""@domain.com "e"@domain.com "\@"@domain.com email@domain "Abc\@def"@example.com "Fred Bloggs"@example.com "Joe\\Blow"@example.com "Abc@def"@example.com customer/[email protected] [email protected] !def!xyz%[email protected] [email protected] _somename@[IPv6:::1] [email protected] [email protected] [email protected] 
plainaddress #@%^%#$@#$@#.com @domain.com email@d.com Joe Smith <[email protected]> email.domain.com email@[email protected] [email protected] [email protected] [email protected] email..email@domain.com ?????@domain.com [email protected] (Joe Smith) [email protected] [email protected] email@[IPv6:127.0.0.1] email@[127.0.0] email@[.127.0.0.1] email@[127.0.0.1.] email@IPv6:::1] [email protected]] email@[256.123.123.123] 

Note: I've skipped the definition of IPv6-addr because this particular RFC gets it wrong and disallows e.g. ::1.

[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] email@[123.123.123.123] "email"@domain.com [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ""@domain.com "e"@domain.com "\@"@domain.com email@domain "Abc\@def"@example.com "Fred Bloggs"@example.com "Joe\\Blow"@example.com "Abc@def"@example.com customer/[email protected] [email protected] !def!xyz%[email protected] [email protected] _somename@[IPv6:::1] [email protected] 
plainaddress #@%^%#$@#$@#.com @domain.com email@d.com Joe Smith <[email protected]> email.domain.com email@[email protected] [email protected] [email protected] [email protected] email..email@domain.com ?????@domain.com [email protected] (Joe Smith) [email protected] [email protected] email@[IPv6:127.0.0.1] email@[127.0.0] email@[.127.0.0.1] email@[127.0.0.1.] email@IPv6:::1] [email protected]] email@[256.123.123.123] 

Note: I've skipped the definition of IPv6-addr because this particular RFC gets it wrong and disallows e.g. ::1. The correct spec is in RFC 2373.

[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] email@[123.123.123.123] "email"@domain.com [email protected] [email protected] [email protected] [email protected] [email protected] [email protected] ""@domain.com "e"@domain.com "\@"@domain.com email@domain "Abc\@def"@example.com "Fred Bloggs"@example.com "Joe\\Blow"@example.com "Abc@def"@example.com customer/[email protected] [email protected] !def!xyz%[email protected] [email protected] _somename@[IPv6:::1] [email protected] [email protected] [email protected] 
plainaddress #@%^%#$@#$@#.com @domain.com Joe Smith <[email protected]> email.domain.com email@[email protected] [email protected] [email protected] [email protected] [email protected] [email protected] (Joe Smith) [email protected] [email protected] email@[IPv6:127.0.0.1] email@[127.0.0] email@[.127.0.0.1] email@[127.0.0.1.] email@IPv6:::1] [email protected]] email@[256.123.123.123] 
Tweeted twitter.com/#!/StackCodeGolf/status/305171154979655680
Source Link
Peter Taylor
  • 43.4k
  • 4
  • 72
  • 179
Loading