any-rule icon indicating copy to clipboard operation
any-rule copied to clipboard

我有更好的正则: email(邮箱)

Open cyb233 opened this issue 3 years ago • 2 comments

来自: https://emailregex.com/

General Email Regex (RFC 5322 Official Standard)

(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\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-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])

或许应该新建条目“通用电子邮件(RFC 5322 官方标准)”?

cyb233 avatar Jul 19 '22 01:07 cyb233

之前有人提过需求, 所以现在邮箱还要可以通过汉字, 这条不支持汉字

any86 avatar Jul 20 '22 01:07 any86

要这么考虑的话,是否应该考虑Unicode域名?

cyb233 avatar Jul 20 '22 15:07 cyb233