ciber Posted February 26, 2009 Share Posted February 26, 2009 I been battling to find a regex statement to do the following: I need to be able to verify an email, but it must only work if the domain matches @mydomain.co.za some of the emails use a . eg, [email protected] and some use a 9 digit id alias [email protected] anyone got any suggestions? Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/ Share on other sites More sharing options...
rhodesa Posted February 26, 2009 Share Posted February 26, 2009 /^[a-z0-9.]@mydomain\.co\.za$/i Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/#findComment-772065 Share on other sites More sharing options...
ciber Posted February 27, 2009 Author Share Posted February 27, 2009 hi, it doesnt want to work I even tried it on this tester site, and nothing.?! http://www.fileformat.info/tool/regex.htm Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/#findComment-772534 Share on other sites More sharing options...
Encrypt Posted February 27, 2009 Share Posted February 27, 2009 ~^[a-z0-9\.]+@mydomain\.co\.za$~i Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/#findComment-772552 Share on other sites More sharing options...
rhodesa Posted February 27, 2009 Share Posted February 27, 2009 yeah...was just gonna update it. I forgot a + /^[a-z0-9.]+@mydomain\.co\.za$/i p.s. - you don't need to escape a period when it's inside [] Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/#findComment-772553 Share on other sites More sharing options...
Encrypt Posted February 27, 2009 Share Posted February 27, 2009 Thanks, my bad Link to comment https://forums.phpfreaks.com/topic/147052-regex-to-approve-email-address/#findComment-772554 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.