匹配邮箱:
var str = "abcd test@runoob.com 1234";
var patt1 = /\b[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6}\b/g;
document.write(str.match(patt1));
分析:


本文介绍了如何使用正则表达式`varstr`在JavaScript中检查电子邮件地址的有效性,通过`varpatt1`示例展示了匹配规则的应用。
匹配邮箱:
var str = "abcd test@runoob.com 1234";
var patt1 = /\b[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,6}\b/g;
document.write(str.match(patt1));
分析:



被折叠的 条评论
为什么被折叠?