I have a weird requirement for setting up a password rule.. 😐
My requirement is to set a password rule to allow only uppercase letters and the min.password length is 5, max password lenght is 8. I used the following expression accordingly..
^(?=.*[A-Z]).{5,8}$
But, It does not work that way. Later, I came to know that the [A-Z] doesn’t mean that only upper case letters are allowed, it means that atleast one should be an upper case.
It works fine with the range{5,8}, kindly guide me in completing the other requirement for allowing only upper case letters..
Can we try setting up negation for all the other things? If so, then do let me know the way to write a negation?
Thanks in advance..
The following sounds like the simplest implementation of what you describe:
I’m not sure why you would need anything like
(?=...)which is a “zero-width positive lookahead”. Just match the string, nothing tricky.