JS正则表达式
<!--<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
window.onload = function() {
var oTxt = document.getElementById('txt1');
var oBtn = document.getElementById('btn1');
//检验邮箱
oBtn.onclick = function() {
var rec = /^\w+@[0-9a-z]+\.[a-z]+$/i;
if(rec.test(oTxt.value)) {
alert('输入的邮箱正确');
} else {
alert('你丫写错了');
}
}
}
</script>
</head>
<body>
<input type="text" id="txt1" />
<input type="button" id="btn1" value="检验" />
</body>
</html>-->