以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  字母和数字判断  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=94616)

--  作者:lfxxdt
--  发布时间:2016/12/28 9:45:00
--  字母和数字判断
用代码如何判断所输入的是字母和数字
--  作者:有点色
--  发布时间:2016/12/28 9:48:00
--  

 判断一个字符,还是判断一串字符?

 

Dim str As String = “12345”
Dim reg1 As new System.Text.RegularExpressions.Regex("^[a-zA-Z]+$")
Dim reg2 As new System.Text.RegularExpressions.Regex("^[0-9]+$")
If reg1.Ismatch(str) = True Then
    msgbox("是字母")
ElseIf reg2.Ismatch(str) = True Then
    msgbox("是数字")
End If


--  作者:lfxxdt
--  发布时间:2016/12/28 10:00:00
--  
已知道了,谢谢