I'm working on a regex to match valid integer numbers such as the following:
- 0
- 1
- 99
- 999
However it should not allow matching an empty string. The closest I can get is:
(0)|\\d{1,3}
Which to me says a matching string will have either a zero or a series of digits between 1 and 3 characters long. However, empty strings still appear to match this pattern. What's the proper way to exclude empty strings from this regex?