1 function isNumberOr_Letter(s){ 2 //var regu = "^[0-9a-zA-Z]{6,12}$"; //可以为全数字或全字母 3 var regu =/^(?!([a-zA-Z]+|d+)$)[a-zA-Zd]{6,12}$/; 4 var re = new RegExp(regu); 5 if (re.test(s)) { 6 return true; 7 }else{ 8 return false; 9 } 10 }
1 function isNumberOr_Letter(s){ 2 //var regu = "^[0-9a-zA-Z]{6,12}$"; //可以为全数字或全字母 3 var regu =/^(?!([a-zA-Z]+|d+)$)[a-zA-Zd]{6,12}$/; 4 var re = new RegExp(regu); 5 if (re.test(s)) { 6 return true; 7 }else{ 8 return false; 9 } 10 }