C# Email Regular Expression — Any out there that adhere to the RFC 2822 guidelines?

后端 未结 4 1661
一个人的身影
一个人的身影 2021-01-01 02:43

I realize that there are a ton of regex email validations, but I can\'t seem to find one that adheres to the RFC 2822 standard.

The ones I find keep letting in junk

4条回答
  •  醉梦人生
    2021-01-01 03:18

    This runs in PCRE: http://code.iamcal.com/php/rfc822/full_regexp.txt

    It's 32k, apparently.

    Seriously - maybe consider backing off using a single regexp, or accepting ALL possible email forms.

提交回复
热议问题