RFC 2822电子邮件验证
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了RFC 2822电子邮件验证相关的知识,希望对你有一定的参考价值。
There are multiple ways of checking email adresses about their validity. This script is based on RFC 2822.Please note that based on RFC 2822 [email protected] is considered valid.
The second snippet is the one I prefer, which only accepts Two-Letter-CCs and the specials com/org/net/gov etc.
(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[x01-x08x0bx0cx0e-x1fx21x23-x5bx5d-x7f]|\[x01-x09x0bx0cx0e-x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[x01-x08x0bx0cx0e-x1fx21-x5ax53-x7f]|\[x01-x09x0bx0cx0e-x7f])+)]) [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)
以上是关于RFC 2822电子邮件验证的主要内容,如果未能解决你的问题,请参考以下文章