Praetorian Posted January 28, 2008 Share Posted January 28, 2008 I'm using this eregi string to validate an email. It works fine for most emails, but I can't figure out how to get it to allow foriegn email addresses such as .co.uk. Any help would be greatly appreciated. ^[a-z0-9]+([!#$%*/?|^{}`~&'+-=_][a-z0-9])*@[a-z0-9]+([!#$%*/?|^{}`~&'+-=_][a-z0-9])*.[a-z]{2,3}$ Link to comment Share on other sites More sharing options...
jhecht Posted January 28, 2008 Share Posted January 28, 2008 I believe ^[a-z0-9]{2,}[a-z0-9]+\@[a-z0-9]{2,}\.[a-z]{2,3}$ Would work. Not 100% sure about it. I'll look through my old projects to get one that works for everything if you need and that doesn't work. Link to comment Share on other sites More sharing options...
justsomeguy Posted January 28, 2008 Share Posted January 28, 2008 ^[a-z0-9]{2,}(\.[a-z0-9]+)*@[a-z0-9]{2,}(\.[a-z0-9]+)*\.[a-z]{2,4}$That should work. You have to allow for dots inside the user name and domain.user.user.user@domain.domain.domain.tld Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.