- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我不是在询问完整的电子邮件验证。
我只想知道电子邮件地址的用户名
和服务器
部分允许使用哪些字符。这可能过于简单化,也许电子邮件地址可以采用其他形式,但我不在乎。我只询问这个简单的形式:user-name@server
(例如 wild.wezyr@best-server-ever.com)以及两个部分中允许的字符。
最佳答案
参见RFC 5322: Internet Message Format并且,在较小程度上,RFC 5321: Simple Mail Transfer Protocol .
RFC 822还涵盖电子邮件地址,但主要涉及其结构:
addr-spec = local-part "@" domain ; global address
local-part = word *("." word) ; uninterpreted
; case-preserved
domain = sub-domain *("." sub-domain)
sub-domain = domain-ref / domain-literal
domain-ref = atom ; symbolic reference
像往常一样,维基百科有一个不错的 article on email addresses :
The local-part of the email address may use any of these ASCII characters:
- uppercase and lowercase Latin letters
A
toZ
anda
toz
;- digits
0
to9
;- special characters
!#$%&'*+-/=?^_`{|}~
;- dot
.
, provided that it is not the first or last character unless quoted, and provided also that it does not appear consecutively unless quoted (e.g.John..Doe@example.com
is not allowed but"John..Doe"@example.com
is allowed);- space and
"(),:;<>@[\]
characters are allowed with restrictions (they are only allowed inside a quoted string, as described in the paragraph below, and in addition, a backslash or double-quote must be preceded by a backslash);- comments are allowed with parentheses at either end of the local-part; e.g.
john.smith(comment)@example.com
and(comment)john.smith@example.com
are both equivalent tojohn.smith@example.com
.
除了 ASCII 字符外,as of 2012您可以使用国际 characters above U+007F
,编码为 UTF-8,如 RFC 6532 spec 中所述。并在 Wikipedia 上进行了解释。请注意,截至 2019 年,这些标准仍标记为“提议”,但正在缓慢推出。此规范中的更改本质上添加了国际字符作为有效的字母数字字符(atext),而不影响允许和限制的特殊字符(例如 !#
)的规则。和@:
.
有关验证,请参阅Using a regular expression to validate an email address .
domain
部分定义as follows :
The Internet standards (Request for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters
a
throughz
(in a case-insensitive manner), the digits0
through9
, and the hyphen (-
). The original specification of hostnames in RFC 952, mandated that labels could not start with a digit or with a hyphen, and must not end with a hyphen. However, a subsequent specification (RFC 1123) permitted hostname labels to start with digits. No other symbols, punctuation characters, or blank spaces are permitted.
关于forms - 电子邮件地址中允许使用哪些字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2049502/
我正在尝试从如下所示的变量中提取一些内容: v1 ","person 2 ") (该变量有数百个观察值) 我想最终创建第二个变量来提取他们的电子邮件以提供以下输出: v2 ","person 2 ")
当您添加 facebook 连接以允许 facebook 用户登录您的站点时,您可以取消用户名和电子邮件地址吗? 最佳答案 是的,您需要先提示他们“电子邮件”数据权限。 Facebook 也在很快改变
我们正在寻求建立一个专门用于商业/商业用途的新网站。我们只需要允许“企业”电子邮件地址注册。因此,使用 Gmail、Hotmail、Yahoo 等的用户无法使用这些电子邮件地址申请。 除了创建 gma
我想通过Identity内的Claim访问我的电子邮件地址 我尝试访问为: var email = User.Identity.GetClaimsByType("emailaddress").ToSt
我正在使用 Hammock 库和 C# 从以下帖子中的链接获取用户的基本配置文件和电子邮件地址 here . 我也关注了这些帖子 here和 here 然而,对于我来说,我无法获得 linkedin
我正在使用 Hammock 库和 C# 从以下帖子中的链接获取用户的基本配置文件和电子邮件地址 here . 我也关注了这些帖子 here和 here 然而,对于我来说,我无法获得 linkedin
我正在尝试制作一个应用程序,通过获取 json 编码数组来从 SQL 数据库获取数据。 它获取地址数据和其他类型的数据,然后将其传递给 Mapkit map View 元素和一些标签/ TextVie
当使用钥匙串(keychain)和证书助手从现有 CA 申请证书时,所有说明都说我应该单击“保存到磁盘”选项,并且不需要“CA 电子邮件地址”。 我看到的面板没有提供“保存到磁盘”选项,当我尝试在没有
我的问题不在于我无法将电子邮件保存到数据库中。任何人都可以做到。这是我的问题: 当用户在我的网站上创建帐户时,他们会获得 ID、用户、密码和电子邮件地址数据。对于密码,我对其进行哈希处理,这样如果有人
我想向非 ASCII 电子邮件地址发送电子邮件,但我不确定使用 JDK8 的推荐程序是什么。 我应该如何处理以下电子邮件地址? Dörte@example.com test@Sörensen.de D
我想阻止用户: 从第一个文本框复制粘贴到第二个 右键单击并使用上下文菜单将第一个文本框复制并粘贴到第二个文本框。 这是行不通的。 Confirm email page
我正在使用两个不同的 Git 存储库(即 github 和 stash),我想为每个存储库使用不同的电子邮件地址。我知道我可以使用 git config 但我不想每次创建新工作区时都必须记住这样做。所
类似于this question ,但不确定在这种情况下如何实现。 受信任的用户(不需要关心验证输入)正在将电子邮件地址键入/粘贴到文本字段中。在模糊事件中,我想查看文本并清理他输入的任何内容(通常是
我正在使用以下代码使用 VBA 发送电子邮件。但是,没有发送电子邮件......我认为这是由于 '.To = ' 代码行中有多个电子邮件地址。有没有办法调整代码以允许多个电子邮件地址? 我试过看 Ro
我正在尝试制作一个脚本,该脚本将在整个网页中搜索以@xyz.com 结尾的电子邮件地址。例如: $(document).ready(function() { $("body:contains(
我们正在使用Office 365,并且遇到了创建重复帐户的问题。这会导致在用户地址上添加数字(john.doe@c0mpany.onmicrosoft.com也将是john.doe5826@c0mpa
我的类型是用户:电子邮件和用户名。 电子邮件字段设置为字符串类型,并使用自定义分析器“exact_lower”: index.analysis.analyzer.exact_lower: type
这个问题已经有答案了: Delete a specific user from Firebase (6 个回答) 已关闭 3 年前。 我正在建立一个网站,其中某个“管理员”用户可以删除任何其他用户的帐
我已经完成 Facebook 登录,但我不知道如何获取电子邮件地址并以其他形式显示它 所以,这就是代码 private void nextActivity(Profile profile){
我有一个付费应用程序,安装后用户可以使用购买该应用程序的电子邮件地址进行注册。 我想知道这个电子邮件地址是否从Google Play购买了我的应用(验证),否则拒绝其注册。有什么办法(API)? 最佳
我是一名优秀的程序员,十分优秀!