• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 165
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What regex are you currently using?
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
That feels good. Thanks. Here's a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic