1
email: function(value, element) {
// From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address
// Retrieved 2014-01-14
// If you have a problem with this implementation, report a bug against the above spec
// Or use custom methods to implement your own email validation
return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-][email protected][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])?)*$/.test(value);
}
我发现上面jQuery验证插件代码这里电子邮件验证我换成别人的正则表达式,但它仍然验证电子邮件作为“例如@例如,”但在我的应用我想它仅用于验证类型为“[email protected]”的电子邮件,只是这个正则表达式只是需要更改或代码的其他部分,因为更改正则表达式并不适用于我需要更改电子邮件中的regex JQuery验证插件
@Naruto它没有我的情况下 – chris
工作真的,真的只是做一些基本的东西(*[email protected]*),实际上**写电子邮件发送到特定的地址为**电子邮件地址往往比首先预期的复杂。 – Jan