Codefixer - ASP tutorials, resources and software
asp.netPRO “Best ASP.NET Host” – DiscountASP.NET
Home   Articles   Resources   ASP directory   ASP Tutorials   Code Snippets   ASP Applications   Forum
Tuesday 13 May
MembersPro PayPal - ASP Membership software

ASP.NET 3.5 Hosting – DiscountASP.NET


ASP Partner ASP Partner ASP Partner more partners...

Email Validation using Regular Expressions in ASP/VBScript

Below is the code for a function 'validEmail' that will check the syntax of an email. Note that the function will only check for the proper syntax it will not check to make sure if the email really exists. If the email is valid then it will return True otherwise it will return False.

<%
Function validEmail(strEmail)
Dim objRE, blnOK
validEmail = False
Set objRE = New RegExp
objRE.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"
objRE.IgnoreCase = true
blnOK = objRE.Test(strEmail)
If Not blnOK Then
Exit Function
End If
validEmail = True
End Function
%>

Using the function above here are 2 examples:

<% Response.write validEmail("test@testemail") %>

Output:
False

<% Response.write validEmail("test@testemail.com") %>

Output:
True



MembersPro PayPal - ASP Membership software

Membership Software Integrates with PayPal

  • Plug and play Membership script.
  • Recurring subscriptions or one time payment.
  • Up to 3 levels of membership subscription.
  • Easy set up and admin with free installation.
  • Works with PayPal.
  • Receive updates and add-ons for 2 years.
  • 1st class support and customization available.
  • Can be customized to support more levels.
  • Saves you hours and hours of development time and money.
  • PURCHASE YOUR COPY TODAY




If you have any code snippets to share with full credit given then send an email to Codesnippets - You'll receive full credit and a link back to your site.

ASP.NET 3.5/2.0 Web Hosting: 3 Months FREE – Click Here!




About | Contact | Advertise | Feedback | Hire Us | Link

Site developed by Michael Wall - Web Design Belfast N.Ireland.
Copyright © 2000-2008. All rights reserved.

Do you intend to move to ASP.NET or have you already?
Yes will do
Have done
ASP does fine
Not a priority


Directory Software