验证以留出电话号码空间
问题描述:
我的.net文本框中有一个验证,其中仅需要数字
i have a validation in my .net textbox where it will take only numbers
但是当我把电话格式设置为
but when i put the the phone format like
080 234234
080 234234
由于空格而无法接受
如何解决这个问题?
任何人都可以在正则表达式中提供帮助吗?
could anyone help in regular expression ?
当前表达是这个[0-9] +
Current expression is this [0-9]+
答
只需在字符范围内添加空格:
Simply add space to characters range:
[0-9][0-9 ]*
您还可以添加开始和停止指示器:
You can also add start and stop indicators:
^[0-9][0-9 ]*$
数字必须以数字开头,后跟数字或空格(零个或多个).
number must start with digit followed with digits or spaces (zero or more).