Function CheckMail(strEmail) 'our variables Dim objRegExp , blnValid 'create a new instance of the RegExp object , note we do not need Server.CreateObject("") Set objRegExp = New RegExp 'this is our pattern we check . objRegExp.Pattern = "^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$" 'store the result either true or false in blnValid blnValid = objRegExp.Test(strEmail) If blnValid Then 'display this if it is a vlid email address CheckMail = true Else 'display this if it is an invalid email address CheckMail = false End If End Function