RegEx in VBE code editor
Hi
as an example (validation of email addresses):
Public Function ValidateEmail(MailAddress As String) As Boolean
Dim oRegExp As Object
Set oRegExp = CreateObject("VBScript.RegExp")
With oRegExp
.Pattern = "^\w+((-\w+)|(\.\w+))*\@\w+((\.|-) \w+) *\.\w+$"
ValidateEmail = .Test(MailAddress)
End With
End Function
--
Regards
Frank Kabel
Frankfurt, Germany
"R Avery" schrieb im Newsbeitrag
...
Is there any addin which would enable this capability? I so often find
myself in positions where a regex would do just the trick.
|