• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regular expression validation to allow all email address with .com and .asia  RSS feed

 
Vinod Vijay
Ranch Hand
Posts: 165
Java Tomcat Server Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My email address validation written in regexp is working fine when it comes to .com. However client side validation fails when it comes to .asia. For instance, the email address as test@abc.asia fails even though it is validate email address in my application whereas test@abc.com gets passed.

Can you please suggest me some standard javascript/jquery validation to allow domain such as .asia also apart from .com.

Thank you,
Regards,
Vinod
 
Dave Tolls
Ranch Foreman
Posts: 3068
37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What regex are you currently using?
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vinod Vijay wrote:My email address validation written in regexp is working fine when it comes to .com. However client side validation fails when it comes to .asia. For instance, the email address as test@abc.asia fails even though it is validate email address in my application whereas test@abc.com gets passed.

This one claims to validate most e-mail addresses, and the site is a pretty good one for all things regex.

You could also look at the RFC 5322 standard, which contains a detailed description of a valid address (you can find a link to it here, along with a regex that claims to be "official"); but as I recall the regex that follows it completely is an absolute monster. The latter link also includes a version for Javascript - though why it would be any different from the standard one I'm not quite sure.

HIH

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!