I have recently encountered this question in the text book:
I am suppose to write a method to check if a string have:
- at least ten characters
- only letters and digits
- at least three digits
I am trying to solve it by Regx, rather than iterating through every character; this is what I got so far:
String regx = "[a-z0-9]{10,}";
But this only matches the first two conditions. How should I go about the 3rd condition?