jaywcjlove / validator.js

:interrobang: Lightweight JavaScript form validation, that had minimal configuration and felt natural to use. No dependencies, support UMD.
https://git.io/validatorjs
551 stars 118 forks source link

邮箱地址包含大写字母,验证无法通过 #24

Closed zhengzhp closed 5 years ago

zhengzhp commented 5 years ago

isEmail函数无法正确验证有大写字母的输入

现在的email校验正则 /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/

rickharrison/validate.js 现在使用的正则 /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

zhengzhp commented 5 years ago

当我没提过这个问题,你竟然还单独修改了限制

jaywcjlove commented 5 years ago

@zhengzhp 你可以自定义正则使用。

zhengzhp commented 5 years ago

@jaywcjlove 已经修改了,我还以为这是个bug,没想到你就是想要这么一个效果