fixing the password validation using regex