Function IsValidEmail(mailAdress)
Dim oRxp
Set oRxp=new RegExp
oRxp.Pattern="^([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$"
IsValidEmail=oRxp.Test(mailAdress)
End Function
Tack!
Är inte helt inne i funktioner och RegExp, anropar jag rätt så här?
Function IsValidEmail(mailAdress)
Dim oRxp
Set oRxp=new RegExp
oRxp.Pattern="^([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-\_]*)[a-zA-Z0-9]{1})@([a-zA-Z0-9]{1}([a-zA-Z0-9\.\-]*)[a-zA-Z0-9]{1})\.([a-zA-Z]{2,4})$"
IsValidEmail=oRxp.Test(mailAdress)
End Function
If IsValidEmail(strEmail) = false Then
Response.Write("Your email address is not valid! Please check the spelling.")
Else