Is there a way that I could modify my expression in order to not allow spaces within the password itself? As of now, it must contain 2 capital, 2 lowercase,2 numbers and can have spaces before and after the password.
/^[ ]*((?=(.*\d){2,})(?=(.*[a-z]){2,})(?=(.*[A-Z]){2,}).{8,16})[ ]*$/
1 Answer