Password Validation: Avoid Spaces

Ok, so I'm trying to stick to the following password rule:

Must be between 6 and 15 characters, include at least one lowercase letter, one uppercase letter, and at least one number. It should also not contain spaces.

Now, for everything except spaces, I have:

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{6,15}$

The problem is that spaces are allowed.

After inspection, I tried to use \s, but it ruined my lowercase and capital requirements. I also saw another offer to replace *with +, but that seemed to break the whole thing.

I created a REFiddle if you want to do a live test.

To clarify, unfortunately, this is a requirement of the client, I never happen so strictly with passwords.

+4
1

:

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)\S{6,15}$

\S NON.

+7

All Articles