本文介绍了C#正则表达式小数范围验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我需要一个正则表达式来验证从-12.0到+12.0的小数值范围
搜索给了很多正则表达式,但没有任何效果。任何人都有正确的rgex请帮助。
提前谢谢
Hi all,
I need a regular expression to validate decimal value ranges from -12.0 to +12.0
Search gave many regex but nothing worked. Anybody having correct rgex for this please help.
Thanks in advance
推荐答案
- accept the optional sign character, followed by
- the digit 1 followed by the digit 2 followed by an optional . followed by any number of 0
- or a single digit or the pair 10 or the pair 11 followed by an optional . followed by any digit(s)
这篇关于C#正则表达式小数范围验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!