I'm trying to create a regex that will accept the following values:
- (blank)
- 0
- 00
- 00.0
- 00.00
I came up with ([0-9]){0,2}\.([0-9]){0,2}
which to me says "the digits 0 through 9 occurring 0 to 2 times, followed by a '.' character (which should be optional), followed by the digits 0 through 9 occuring 0 to 2 times. If only 2 digits are entered the '.' is not necessary. What's wrong with this regex?