Praetorian Posted January 28, 2008 Report 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 Report 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 Report 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
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now