Solved

email validation Regex Validation Expression

Posted on 2013-05-15
4
418 Views
Last Modified: 2013-05-16
Hi I have an email address that is not passing my regex validation.
anyone know the correct syntax to deal with
aaa.bbb-@aaa.co.uk it's the dash that is casing the issue

I currently have tried

^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@(([0-9a-zA-Z])+([-\w]*[0-9a-zA-Z])*\.)+[a-zA-Z]{2,9})$


^([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})(\]?)$
0
Comment
Question by:Simon Cripps
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39168772
Open this link in your browser (or a text editor) : http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js

search for : Plugins/Validation/Methods/email
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39168889
You could set the input type to "email" and let the browser do the work.

Cd&
0
 
LVL 84

Expert Comment

by:ozo
ID: 39169134
0
 
LVL 18

Accepted Solution

by:
nap0leon earned 500 total points
ID: 39169475
Try this function from when I asked the question a couple years ago.  Used this function on a Fortune 500's eCommerce site for a number of years without any hiccups.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_24417659.html
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question