Regex digits smaller then 82

regex

Solution

You should have `[1-7]` for the range 10-79, not `[1-8]`. Don't forget the `^` and `$` to specify the start and ending of the string:

^(0[1-9]|[1-7]\d|8[0-2])$

Problem

I'm trying to write a simple regex but I don't know why it is not working. User enter 2 digits number like `01`, `09`, `23`, `55`, until `82`. After `82` system will refuse. Here is my regex, 2 digits must be smaller than 82. ``` 0[1-9]|[1-8][0-9]|8[0-2] ```

Original source