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.'); }
Write a piece of js code to complete the field verification rules: must contain uppercase and lowercase letters and numbers.
Guess you like
Origin blog.csdn.net/weixin_42602241/article/details/129565248
Recommended
Ranking