Hi,
I need to validate some user input, to ensure a number entered is in the range of 1-99 inclusive. These must be whole (Integer) values
Preceeding 0 is permitted, but optional
Valid values
- 1
- 01
- 10
- 99
- 09
Invalid values
- 0
- 007
- 100
- 10.5
- 010
So far I have the following regex that I've worked out : ^0?([1-9][0-9])$
This allows an optional 0 at the beginning, but isn't 100% correct as 1
is not deemed as valid
Any improvements/suggestions?