本文介绍了电子邮件,后缀为4个字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 亲爱的名单, 我们正在让一些人试图通过以下形式的电子邮件注册我们的观鸟调查 : an *** @ phonecoop.coop ,换句话说,有一个4 字符结尾(其他例子是.info)。 目前,我使用正则表达式来检查带有3个字符的正常电子邮件..... 函数checkEmail() { var emailVar = document.shorter.email.value; if(emailVar.length> 0){ if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\\\\ ,3})+ $ / .test(document.shorter.email ..value)) { return(true) } 其他 { 提醒(无效的电子邮件地址!请重新输入。 ;) document.shorter.email.select(); } } } 有没有人知道可以处理e类型的类似功能邮件我 上面描述了4个字符?我对regexp正在做的事情的了解有点暂时无限(没有 - 对我来说看起来很乱,但它确实有用 很好!) 干杯 Iain Iain Downie博士 英国鸟类学信托,女修道院,诺福克IP24 2PU,UK 电话:+44(0)1842 750050,传真:+44(0)1842 750030?慈善机构编号216652 解决方案 / .test(document.shorter.email ..value)) { 返回(true) } 其他 { alert(无效的电子邮件地址!请重新输入。) document.shorter.email.select(); } } } 有没有人知道类似的功能可以处理我所描述的电子邮件类型 描述上面有4个字符?我对regexp正在做的事情的了解有点暂时无限(没有 - 对我来说看起来很乱,但它确实有用 很好!) 干杯 Iain Iain Downie博士 英国鸟类学信托,女修道院,诺福克IP24 2PU,UK 电话:+44(0)1842 750050,传真:+44(0)1842 750030?慈善机构编号216652 Iain Downie写道: 亲爱的清单, 我们正在获得一个很少有人试图通过以下形式的电子邮件注册我们的观鸟调查: an***@phonecoop.coop ,in字符结尾为4 的其他单词(其他例子是.info)。 目前,我使用正则表达式来查看带有3个字符的正常电子邮件..... 函数checkEmail(){> / email / text.shorter.email.value; if(emailVar.length> 0){ if (/^\w+([\.]?\\\++)*@\ w+([\.-]?\\\ ++)*(\。\\\\\\\\\\\\ + /.test(document.shorter.email .value)) { [snip] (/^\w+([\.-]?\w+)*@\w+([\.-]?\\\+) *(\.\w {2,})+ Dear list,we are getting a few folk trying to register for our birdwatching surveyswith emails of the form: an***@phonecoop.coop, in other words with a 4character ending (other examples are .info).Currently, I use a regexp to check on ''normal'' emails with 3 chars.....function checkEmail() {var emailVar = document.shorter.email.value;if (emailVar.length > 0){if(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.shorter.email..value)){return (true)}else{alert("Invalid E-mail Address! Please re-enter.")document.shorter.email.select();}}}Does anyone know of a similar function that can handle the type of e-mail Idescribed above with 4 chars? My knowledge of what regexp is doing is a tadlimited to say the least (none - looks gibberish to me but it does workwell!)CheersIainDr Iain DownieBritish Trust for Ornithology, The Nunnery, Norfolk IP24 2PU, UKTel: +44 (0)1842 750050, fax: +44 (0)1842 750030 ? Charity No. 216652 解决方案 /.test(document.shorter.email..value)){return (true)}else{alert("Invalid E-mail Address! Please re-enter.")document.shorter.email.select();}}}Does anyone know of a similar function that can handle the type of e-mail Idescribed above with 4 chars? My knowledge of what regexp is doing is a tadlimited to say the least (none - looks gibberish to me but it does workwell!)CheersIainDr Iain DownieBritish Trust for Ornithology, The Nunnery, Norfolk IP24 2PU, UKTel: +44 (0)1842 750050, fax: +44 (0)1842 750030 ? Charity No. 216652Iain Downie wrote: Dear list, we are getting a few folk trying to register for our birdwatching surveys with emails of the form: an***@phonecoop.coop, in other words with a 4 character ending (other examples are .info). Currently, I use a regexp to check on ''normal'' emails with 3 chars..... function checkEmail() { var emailVar = document.shorter.email.value; if (emailVar.length > 0){ if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+/.test(document.shorter.email .value)) {[snip](/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,})+ 这篇关于电子邮件,后缀为4个字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-18 03:09