Email 的正确地址中有特殊符号嘛?

jlzan1314 2010-05-25 09:28:07
在维基中说有

! # $ % & ' * + - / = ? ^ _ ` { | } ~

这些在用户名都可以

但为什么一般的email验证不带上这几个函数?

http://en.wikipedia.org/wiki/E-mail_address


头大,一个perl的系统如果改的话,改的东西就太多了.
...全文
7054 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mr微風輕揚 2012-08-28
  • 打赏
  • 举报
回复
邮箱注册验证时的特殊字符的判断,求解……
xuzuning 2010-05-26
  • 打赏
  • 举报
回复
Within the rules set out in the RFCs, organisations are free to restrict the forms their own e-mail addresses take however they wish, e.g. many organizations do not use certain characters, e.g. space, ?, and ^, and most organizations treat uppercase and lowercase letters as equivalent. Hotmail, for example, only allows creation of e-mail addresses using alphanumerics, dot (.), underscore (_) and hyphen (-).[2]
Systems that send mail, of course, must be capable of handling outgoing mail for all addresses. Contrary to the relevant standards, some defective systems treat certain legitimate addresses as invalid and fail to handle mail to these addresses. Hotmail, for example, incorrectly refuses to send mail to any address containing any of the following legitimate characters: ! # $ % * / ? ^ ` { | } ~
在设置在RFC中制定的规则,组织形式自由,限制他们自己的电子邮箱地址,但他们采取的愿望,如:许多组织不使用某些字符,例如空间?,和^,和大多数组织对待大写和小写字母等同。 Hotmail的,例如,只允许创建的电子邮件地址使用字母,数字,圆点(。),下划线(_)和连字符(-).[ 2]
系统发送邮件的过程中,必须处理所有地址发送邮件的能力。相反的有关标准,一些有缺陷的系统视为无效的某些合法的地址,不处理邮件给这些地址。 Hotmail的,例如,错误地拒绝向任何地址发送邮件包含以下任何合法的字符:! #$%* /? ^`(|)〜

规则总是规则,实现起来就大打折扣了
hejianaini 2010-05-26
  • 打赏
  • 举报
回复
好像同有碰到过,网上好多难邮箱的正则,都没有包含这些特殊符号
Dleno 2010-05-25
  • 打赏
  • 举报
回复
Hotmail, for example, incorrectly refuses to send mail to any address containing any of the following legitimate characters: ! # $ % * / ? ^ ` { | } ~

这句貌似还是说的不能。
jlzan1314 2010-05-25
  • 打赏
  • 举报
回复
我碰到了带'号的email..,所以来讨论下. 也出乎我的意料.


原文:

E-mail addresses are formally defined in RFC 5322 (mostly section 3.4.1) and to a lesser degree RFC 5321. An e-mail address is a string of a subset of ASCII characters (see however the internationalized addresses below) separated into 2 parts by an "@" (at sign), a "local-part" and a domain, that is, local-part@domain.
The local-part of an e-mail address may be up to 64 characters long and the domain name may have a maximum of 255 characters. However, the maximum length of a forward or reverse path length of 256 characters restricts the entire e-mail address to be no more than 254 characters.[1] Some mail protocols, such as X.400, may require larger objects, however. The SMTP specification recommends that software implementations impose no limits for the lengths of such objects.
The local-part of the e-mail address may use any of these ASCII characters:
Uppercase and lowercase English letters (a–z, A–Z)
Digits 0 to 9
Characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively (e.g. John..Doe@example.com).
Additionally, quoted-strings (e.g. "John Doe"@example.com) are permitted, thus allowing characters that would otherwise be prohibited, however they do not appear in common practice. RFC 5321 also warns that "a host that expects to receive mail SHOULD avoid defining mailboxes where the Local-part requires (or uses) the Quoted-string form" (sic).
The local-part is case sensitive, so "jsmith@example.com" and "JSmith@example.com" may be delivered to different people. This practice is discouraged by RFC 5321. However, only the authoritative mail servers for a domain may make that decision. The only exception is for a local-part value of "postmaster" which is case insensitive, and should be forwarded to the server's administrator.
Within the rules set out in the RFCs, organisations are free to restrict the forms their own e-mail addresses take however they wish, e.g. many organizations do not use certain characters, e.g. space, ?, and ^, and most organizations treat uppercase and lowercase letters as equivalent. Hotmail, for example, only allows creation of e-mail addresses using alphanumerics, dot (.), underscore (_) and hyphen (-).[2]
Systems that send mail, of course, must be capable of handling outgoing mail for all addresses. Contrary to the relevant standards, some defective systems treat certain legitimate addresses as invalid and fail to handle mail to these addresses. Hotmail, for example, incorrectly refuses to send mail to any address containing any of the following legitimate characters: ! # $ % * / ? ^ ` { | } ~
The domain name is much more restricted: it must match the requirements for a hostname, consisting of letters, digits, hyphens and dots. In addition, the domain may be an IP address literal, surrounded by square braces, such as jsmith@[192.168.2.1] (this is rarely seen except in spam).
The informational RFC 3696 written by the author of RFC 5321 explains the details in a readable way, with a few minor errors noted in the 3696
Dleno 2010-05-25
  • 打赏
  • 举报
回复
到底是否支持还不知道。

但到目前为止,碰到的所有email格式就是@数字字母,中,下划线。没别的了。
连国外的也没碰到过包含那些特殊字符的。
餅餅 2010-05-25
  • 打赏
  • 举报
回复
去新浪 网易注册下试试
jlzan1314 2010-05-25
  • 打赏
  • 举报
回复
刚开始我也觉得有符号的不行,看维基吓了一跳.连空格也可以..,这回麻烦大了.
phpboy 2010-05-25
  • 打赏
  • 举报
回复
一般直持 - 和 _

其它的好像不行吧
床上等您 2010-05-25
  • 打赏
  • 举报
回复
基本网站都是 -_ 这两个居多

有的可以有 . 这个点。

但有 * #之类的,实属少见。
JAVA_STU 2010-05-25
  • 打赏
  • 举报
回复
无。接分
donghao0214 2010-05-25
  • 打赏
  • 举报
回复
不了解...
江南昆虫 2010-05-25
  • 打赏
  • 举报
回复
我原来知道的是邮箱可以有“_”,域名可以有“-”,不过自从某些机构推出中文邮箱、中文域名后,我啥想法都没有了...

20,359

社区成员

发帖
与我相关
我的任务
社区描述
“超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。PHP语法利用了C、Java和Perl,该语言的主要目标是允许web开发人员快速编写动态网页。
phpphpstorm 技术论坛(原bbs)
社区管理员
  • 开源资源社区
  • phpstory
  • xuzuning
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧