87,907
社区成员
发帖
与我相关
我的任务
分享
function check(str){
return /^[a-z\u4e00-\u9fa5\d]+$/.test(str)&& !!str.replace(/[^\x00-\xff]/g,"**").match(/^.{4,20}$/)
}
alert( check("测试测试测试12aA") );
function check(str){
return !!str.replace(/[^\x00-\xff]/g,"**").match(/^.{4,20}$/)
}
alert( check("测试测试测试测试测试测试") );