非十进制正整数的正则表达式,范围在0到999999之间 [英] Regular Expression for Non decimal positive integer ranging between 0 to 999999

查看:901
本文介绍了非十进制正整数的正则表达式,范围在0到999999之间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要匹配所有正非十进制整数的正则表达式,其范围从0到999999.它将不接受任何十进制,字母或任何特殊字符,范围应在0到999999之间.

I need the regular expression which matches all positive non decimal integers only range from 0 to 999999. It will not accept any decimal, alphabets or any special character and range should be in between 0 to 999999.

推荐答案

尝试以下操作:
Try the following:
\s+\d{1,6}\s+


它将为您提供1234并包含以下数据:


It will give you 1234 with the following data :

1234567
1234
abc1111


尝试以下正则表达式:^[0-9]{1,6}
Try this regex: ^[0-9]{1,6}



要对此进行测试,您可以转到以下链接:
http://www.regular-expressions.info/javascriptexample.html [

To test this you can go to below link:
http://www.regular-expressions.info/javascriptexample.html[^]


这篇关于非十进制正整数的正则表达式,范围在0到999999之间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆