Password Regex Validation: Preventing Spaces
Okay, so I'm trying to adhere to the following password rule:
Must be 6 to 15 characters, include at least one lowercase letter, one
uppercase letter and at least one number. It should also contain no
spaces.
Now, for everything but the spaces, I've got:
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{6,15}$
Problem is, that allows spaces.
After looking around, I've tried using \s, but that messes up my lowercase
and uppercase requirements. I also seen another suggestion to replace the
* with a +, but that seemed to break the entire thing.
I've created a REFiddle if you want to have a live test.
No comments:
Post a Comment