In such case, IMO, it would be better if you create your own validator class, because regexps aren't very readable.Originally Posted by whitefurrows
Anyway, suppose you want a regexp for 65-105 range. Valid numbers are:
65, 66, 67, 68, 69, 70, ..., 79, 80, ..., 89, 90, ..., 99, 100, 101, 102, 103, 104, 105
There are three possibilities:
- 6 and one of {5, 6, 7, 8, 9} -> 6[5-9]
- one of {7, 8, 9} and a digit -> [7-9]\\d
- 10 and one of {0, 1, 2, 3, 4, 5} -> 10[0-5]
and you just have to join them: 6[5-9]|[7-9]\\d|10[0-5]
Because you can enter 1500.00e-2, which is a valid number.Originally Posted by whitefurrows
Bookmarks