由英文字母、数字和空格组成
如何对某一格内容进行
(由英文字母、数字和空格组成)
判断?
初学者,勿见笑..
[解决办法]
首先,工程-引用,选择“Microsoft VBScript Regular Expressions 5.5”
Function RegExpTest(patrn, strng)
Dim regEx, retVal
' Create regular expression.
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = False
' Do the search test.
retVal = regEx.Test(strng)
If retVal Then
RegExpTest = "One or more matches were found."
Else
RegExpTest = "No match was found."
End If
End Function
MsgBox(RegExpTest("^[a-z0-9A-Z ]+$", "123aaa"))
MsgBox(RegExpTest("^[a-z0-9A-Z ]+$", "123aaa我;"))