You are on page 1of 1

Sub RegEx_Tester()

Set objRegExp_1 = CreateObject("vbscript.regexp")


objRegExp_1.Global = true
objRegExp_1.IgnoreCase=true
objRegExp_1.Pattern=[a-z,A-Z]*@[a-z,A-Z]*.com.
strToSearch="ABC@xyz.com"
Set regExp_Matches = objRegExp_1.Execute(strToSearch)
If regExp_Matches.Count = 1
MsgBox("This string is a valid email address.")
End if
End Sub

'using regex to check if ist spy or obj


Dim objRegExp As Object

You might also like