输入数字并开始的验证表达式 [英] Validation expression to enter numbers and starts
本文介绍了输入数字并开始的验证表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一个Validation表达式,该表达式允许我在SSN文本框中输入整数和"*"作为字符?有人可以在这里帮我吗?
I need a Validation expression which will allow me to enter integer and "*" as a character in the SSN Text box? Can anybody help me here?
推荐答案
使用正则表达式:
!Regex.IsMatch(textbox.Trim(),@"^-{0,1} \ d * \ * {0,1} \ d +
use regular expression:
!Regex.IsMatch(textbox.Trim(), @"^-{0,1}\d*\*{0,1}\d+
")
尝试一下
在正则表达式中
"^([0-9 *])
Try This
in Regularexpression
"^([0-9*])
这篇关于输入数字并开始的验证表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文