Write a piece of js code to complete the field verification rules: must contain uppercase and lowercase letters and numbers.

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.'); }

Guess you like

Origin blog.csdn.net/weixin_42602241/article/details/129565248