开发者

Match 0 to 60 in regular expression

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)/
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜