Hi, I would like to check if a string contains:
- at least 1 number
- at least 2 characters (uppercase or lowercase)
This is the regex I though I might use:
(?=(?:.*?\d))(?=(?:.*?[A-Za-z]){2})
With aa1 the test gives a false statement, while with a1a or 1aa it gives a true result.
The strange thing is that if I change the order of the controls in the regexp:
(?=(?:.*?[A-Za-z]){2})(?=(?:.*?\d))
all 3 of the test string I used wives a true value.
How is it possible?
Thanks