Dim pattern As String = "^[1][345789][0-9]{9}$"
Dim txt as string= “13512341234”
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If rgx.isMatch(txt) = False Then
e.WriteString("请输入正确的手机号!")
Return ""
End If
上面是已经能够正确使用的代码,现在想改为:
判断一个字符串是否在1000~1000000000之间,必须全部是数字,怎么改代码?
Dim pattern As String = "^[1][345789][0-9]{9}$"
Dim txt as string= “1355de35”
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If rgx.isMatch(txt) = False Then
e.WriteString("请输入正确的编号!")
Return ""
End If
[此贴子已经被作者于2017/9/10 18:38:56编辑过]