正则表达式为-100到100,带有2位十进制数字。 [英] Regex for -100 to 100 with 2 decimal digits.
本文介绍了正则表达式为-100到100,带有2位十进制数字。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友,
我想要正常表达式来验证-100到100之间的输入
输入像99.99和-99.99和0太
目前我使用的是:
^ 100 $ | ^ \ * *(\ d { 0 , 2 })((\。| \,)(\\\ { 0 , 2 }))?\ * * \%?\ s * $
以上reg-ex允许0到100十进制到2位数。
请尽快帮助我
先谢谢..
解决方案
| ^ \ * * (\d { 0 , 2 })((\。| \,)(\\ \ { 0 , 2 }))?\ * * \%?\ * *
以上reg-ex允许0到100十进制到2位数。
请尽快帮助我
在此先感谢..
< blockquote>有2个数字,它不是-100到100,它是-99到-99。解决方案:允许1到2位数字,在数字之前,0到1' - '。
Hello friends,
I want regular expression for validating input between -100 to 100 only
Input like 99.99 and -99.99 and 0 too
Currently i used :
^100$|^\s*(\d{0,2})((\.|\,)(\d{0,2}))?\s*\%?\s*$
Above reg-ex will allow 0 to 100 decimal up to 2 digit.
Please Help Me ASAP
Thanks in Advance..
解决方案
|^\s*(\d{0,2})((\.|\,)(\d{0,2}))?\s*\%?\s*
Above reg-ex will allow 0 to 100 decimal up to 2 digit.
Please Help Me ASAP
Thanks in Advance..
With 2 digits, it's not -100 to 100, it's -99 to -99. The solution: allow 1 to 2 digits and, before digits, 0 to 1 '-'.
—SA
这篇关于正则表达式为-100到100,带有2位十进制数字。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文