var regex = new RegExp("^(?=.[a-z])(?=.[A-Z])(?=.*[0-9]).{8,}$"); if(regex.test(yourString)){ console.log('The string is valid.'); } else { console.log('The string is not valid.'); }
写一段js代码,完成字段校验规则:必须包含大小写字母和数字。
猜你喜欢
转载自blog.csdn.net/weixin_42602241/article/details/129565248
今日推荐
周排行