A password meter guides the user with developing a strong password. I would like to have the password requirements below implemented on the meter. I've added the highlighted code below with RegEx, however the code does not detect the required password guidelines. What is the correct code to detect the requirements below?
- 8+ characters
- Upper and lowercase letters
- Special characters
- Must not contain 4+ continuous letters
- Must not contain 4+ continuous numbers
Example:
Test%401 = Insufficient
2323Ejsdh! = Insufficient
Tlv!897% = Strong
302^PLs# = Strong
if(val.length > 7 && val.match(/\d{4}/) && val.match(/[a-zA-Z]{4}/) && val.match(/[~,!,@,#,$,%,^,&,*,(,),+,-,?]/))