Regular Expression Example - Test Method

Function RegExpTest(patrn, strng) 
Dim regEx, retVal                    ' Create variable. 
Set regEx = New RegExp     ' Create regular expression. 
regEx.Pattern = patrn                    ' Set pattern. 
regEx.IgnoreCase = False        ' Set case sensitivity. 
retVal = regEx.Test(strng)   ' Execute the search test.
If retVal Then 
  RegExpTest = "One or more matches were found." 
Else 
  RegExpTest = "No match was found." 
End If 
End Function 
MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4"))