We are using a RegEx Validator to validate an input from a textbox.
The current RegEx expression checks if the current number is between the range of 1 – 999.
We just inherited this code and we need to change the range from 999 to just 365. In short, we need to write a regex to check if the input is between 1 – 365.
Of course, we can just use a RangeValidator or a custom validator. But we don’t want to do that because we don’t want to introduce a “significant” change.
Thanks!
EDIT:
We should also catch this following patterns:
001 for 1
019 for 19
Using regular expressions is certainly not the best way to validate integer ranges, but here you go:
EDIT: With leading zeros (also matches strings like 00000000321):