James Peter wrote:
but both are not working with min max length condition of the string. please let me know where i am doing wrong.
How are you using the expression? Are you using the find() method? Or the matches() method?
With the second password pattern, the matches() method should work (or at least, by eyeballing it, I didn't actually try it out).
2) You need to use matches() and not find() or the length check term will pass for lengths greater than 7.
P.S. What business case can be made for limiting a password to less than 8 characters? Seems daft to me as presumably one is only storing a seeded digest and not the full password and it reduces significantly the entropy of the allowable passwords.
James Peter wrote:Hi Henry,
Thanks for adding code tag. I was about to do that.
thanks for your comment. I forgot to add "&" character in the set. after adding it is working fine.
But did you fix the 'length' term and change to use matches() rather than find()?