正则表达式验证器 [英] Regular Expression Validator
本文介绍了正则表达式验证器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在asp.net中,我想使用正则表达式验证器作为数字。
要求只允许3个数字和短划线( - )
例如:
编号从0到9
123-123-123
试试这个:
^ [0-9] { 3 } - [0-9] { 3 } - [0-9] { 3 }
在这里学习
30分钟正则表达式教程 [ ^ ]
试试这个:
^ \d {3}( - \d {3})+
In asp.net, I want to use Regular Expression Validator for number.
Requirement is only to allow 3 numbers and Dash (-)
For Example:
number any from 0 to 9
123-123-123
解决方案
try this :
^[0-9]{3}-[0-9]{3}-[0-9]{3}
learn here
The 30 Minute Regex Tutorial[^]
try this:
^\d{3}(-\d{3})+
这篇关于正则表达式验证器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文