对文本框中的数字使用正则表达式验证器 [英] Using a Regular Expression Validator for numbers in a textbox
本文介绍了对文本框中的数字使用正则表达式验证器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用正则表达式验证器确保仅在文本框中输入3.00这样的数字?
How can I use a Regular Expression Validator to ensure that only a number like 3.00 is entered into a text box?
推荐答案
如果要验证123、123.,123.12和.23之类的情况,则可以使用以下内容:
If you want to verify those cases like 123, 123., 123.12, and .23, the following may be used:
ValidationExpression="(\d+\.\d+)|(\d+\.)|(\.\d+)|(\d+)"
这篇关于对文本框中的数字使用正则表达式验证器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文