验证Email地址是否合法
<script language="javascript">
function isEmail(email) {
if (email.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1) {
return true;
}
else {
return false;
}
}
</script>
验证IP地址
IPV4_PATTERN = "(([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.){3}([01]?\\d\\d?|2[0-4]\\d|25[0-5])";
IPV6_PATTERN = "([0-9a-f]{1,4}:){7}([0-9a-f]){1,4}";
待续。。。
posted on 2009-07-29 00:51
jadmin 阅读(69)
评论(0) 编辑 收藏