Write a piece of js code to complete the field verification rules: the length of the field must be between 6-20 characters, and must contain uppercase and lowercase letters and numbers. ...

var regex = /^(?=. \d)(?=. [az])(?=.*[AZ]).{6,20}$/; if (regex.test(field)) { console. log('Field verification successful'); } else { console.log('Field verification failed'); }

Guess you like

Origin blog.csdn.net/weixin_42590539/article/details/129591141
Recommended