What is the regular expression to match the numbers 0 through 60? No negat开发者_如何学Pythonive numbers allowed and no decimals.
Like this: ^([0-5]?[0-9]|60)$
In C#:
int temp;
if (int.TryParse(str, out temp) && temp >= 0 && temp <= 60)
Assuming Perl compatible regular expressions, and no leading zeroes
/([1-5]?[0-9]|60)/
精彩评论