Jump to content

String comparison


Praetorian
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...