What would be a globally accepted regular expression to match e
I have seen many examples, with many 'no, you missed something' comments. What is the right way to match an e-mail address?
For Sanity sake, only fully-qualified domain names, no @localhost allowed. (or, both ways)
Subdomains must be allowed (issac@deptartment.company.museum)
这个正则表达式符合RFC 2822中描述的语法,它很长,但RFC中描述的语法很复杂。
It is impossible to do so in a pure regex. Regexen cannot match nested parentheses, which the full RFC spec requires. (The latest RFC on this matter is RFC5322, only released a few months ago.)
Full validation of email addresses requires something along the lines of a CFG, and there are a few more things to be wary of; for example, email addresses can contain '