Try:
\d{1,2}
Digit, one or two only.
If you want only 0-24, then you would have to list them individually:
00|01|02|0|1|2
(only all the way to 24)
To be honest, I wouldn't use a regex alone: I would convert the text box content to a number, and check that.