tmyonline Posted May 18, 2008 Share Posted May 18, 2008 Hi guys: I need a regex to validate emails of the forms "[email protected]" and "[email protected]" ? How can I achieve this ? Thanks. Link to comment https://forums.phpfreaks.com/topic/106128-solved-regex-needed-to-validate-emails/ Share on other sites More sharing options...
Orio Posted May 18, 2008 Share Posted May 18, 2008 I personally use: if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)) Orio. Link to comment https://forums.phpfreaks.com/topic/106128-solved-regex-needed-to-validate-emails/#findComment-544023 Share on other sites More sharing options...
tmyonline Posted May 18, 2008 Author Share Posted May 18, 2008 Orio, Thanks a lot. It helps. Link to comment https://forums.phpfreaks.com/topic/106128-solved-regex-needed-to-validate-emails/#findComment-544388 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.