Jump to content

String comparison


Praetorian

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...