【问题标题】:What is the RFC 822 format for the email addresses?电子邮件地址的 RFC 822 格式是什么?
【发布时间】:2013-09-04 07:01:54
【问题描述】:

我必须为电子邮件地址 (RFC 822) 制作一个正则表达式,并且我想知道本地部分和域中允许哪些字符。

我找到了这个https://www.rfc-editor.org/rfc/rfc822#section-6.1,但我没有看到它说明哪些是有效字符。

【问题讨论】:

标签: email character email-validation rfc822


【解决方案1】:

根据RFC 822,本地部分可以包含任何ASCII字符,因为local-part是使用word定义的,它被定义为atom / quoted-stringatom 涵盖了大多数 ASCII 字符,其余的可以写成 quoted-string。有句法限制,但遵守它们,任何 ASCII 字符都可以使用。

基于类似的理由,RFC 822 允许在 domain 部分中使用任何 ASCII 字符。

另一方面,RFC 822 在 2001 年被 RFC 2822 淘汰,而后者又在 2008 年被 RFC 5322 淘汰。可以从 RFC 编辑器的RFC database 检查 RFC 的状态。

【讨论】:

    猜你喜欢
    • 2014-10-11
    • 2013-10-29
    • 1970-01-01
    • 1970-01-01
    • 2014-07-28
    • 1970-01-01
    • 1970-01-01
    • 2018-09-09
    • 1970-01-01
    相关资源
    最近更新 更多