username1: “(^[a-zA-Z]{1}([a-zA-Z0-9_]){4,14}|(^[u4E00-uFA29]{1}+[a-zA-Z0-9u4E00-uFA29]{2,7}))$”,
复制代码 代码如下:
<script>
<!–
function checkStr(str){
// [u4E00-uFA29]|[uE7C7-uE7F3]汉字编码范围
var re1 = new RegExp(“^([u4E00-uFA29]|[uE7C7-uE7F3]|[a-zA-Z0-9])*$”);
if (!re1.test(str)){
alert(“否”);
return false;
}
alert(“是”);
return true;
}
//–>
</script>
<!–
function checkStr(str){
// [u4E00-uFA29]|[uE7C7-uE7F3]汉字编码范围
var re1 = new RegExp(“^([u4E00-uFA29]|[uE7C7-uE7F3]|[a-zA-Z0-9])*$”);
if (!re1.test(str)){
alert(“否”);
return false;
}
alert(“是”);
return true;
}
//–>
</script>