一个电子邮件地址中可以有多少个@符号? [英] How many @ symbol can be in an email address?

查看:303
本文介绍了一个电子邮件地址中可以有多少个@符号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何规则在任何电子邮件ID中都包含指定数量的@符号. 请记住,如果我们要检查电子邮件ID是否有效或不使用PHP.

解决方案

如果使用引号,则允许多个@.我必须问你为什么需要这些信息.请请不要尝试编写正则表达式/函数或任何用于验证电子邮件地址的内容.您必须担心3个rfc(如果要考虑unicode,则可能需要4个).而您失败,并且它使您发疯.

有关更多信息和正则表达式的信息,请参阅我以前的答案

P.S.

万一有人错过了我的观点:不要尝试对您自己的邮件进行验证,以永远"验证电子邮件地址.

Is there any rule for having a specified amount of @ symbol in any email id. Just come to my mind if we're to check if an email id is valid or not using PHP.

解决方案

If enquoted multiple @ are allowed. I have to ask why do you need this information. Please please please do not try to write a regex / function or whatever to validate emailaddresses. You have to worry about 3 rfc's (and perhaps 4 if you want to take into account unicode). And you will fail and it will drive you mad.

See my previous answer for more information and a regex you may use if you have an older version of PHP

P.S.

In case someone missed my point: do not try to come up with some validation of your own to validate emailaddresses yourself "ever".

这篇关于一个电子邮件地址中可以有多少个@符号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆