验证以留出电话号码空间 [英] Validation to allow space for phone numbers
本文介绍了验证以留出电话号码空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的.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).
这篇关于验证以留出电话号码空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文