I\'m trying to validate emails but my code is not allowing a few scenarios..
Code
pvm = \"bw.stack@domain.com\" does not work
pvm = \"user@gmail.com\
Here is a fairly good valiation for email addresses. Please note though that its hard to get a completely 'all-knowing' validation.
' Function IsValidEmail
' Method checks if a string value is a valid email adress
' @Param val: String containing email adress.
' @RETURN: True / False
Public function IsValidEmail(ByRef val)
IsValidEmail = RegExTest(val,"^[_a-zA-Z0-9-""'\/]+(\.[_a-zA-Z0-9-""'\/]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.(([0-9]{1,3})|([a-zA-Z]{2,3})|(aero|coop|info|museum|name))$")
end function
_
Public function RegexTest(str, pattern)
dim m_objRegex
set m_objRegex = New RegExp
m_objRegex.Pattern = pattern
m_objRegex.Global = True
RegExTest = m_objRegex.Test(str)
set m_objRegex = nothing
End function