什么是与电子邮件地址匹配的全局接受的正则表达式 [英] What would be a globally accepted regular expression to match e-mail addresses

查看:72
本文介绍了什么是与电子邮件地址匹配的全局接受的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过很多例子,其中有很多不,你错过了一些东西"的评论.匹配电子邮件地址的正确方法是什么?

I have seen many examples, with many 'no, you missed something' comments. What is the right way to match an e-mail address?

出于理智的考虑,仅使用完全限定的域名,不允许使用@localhost. (或两种方式)

For Sanity sake, only fully-qualified domain names, no @localhost allowed. (or, both ways)

必须允许子域(issac@deptartment.company.museum)

Subdomains must be allowed (issac@deptartment.company.museum)

推荐答案

正则表达式符合 RFC 2822 中描述的语法,它很长,但是RFC中描述的语法很复杂...

This regular expression complies with the grammar described in RFC 2822, it's very long, but the grammar described in the RFC is complex...

这篇关于什么是与电子邮件地址匹配的全局接受的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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