aebstract Posted January 16, 2009 Share Posted January 16, 2009 So I'm trying to match an email with a regular expression to make sure it is at least a valid email in some sort of way. } elseif (!preg_match('\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b',$_POST['email1'])) { Entering an actual email address and I'll return my error on the next line that it is invalid. I'm thinking I got some sort of syntax with the preg_match incorrect? Quote Link to comment https://forums.phpfreaks.com/topic/141080-solved-matching-email-with-regular-expression/ Share on other sites More sharing options...
RussellReal Posted January 16, 2009 Share Posted January 16, 2009 you forgot regex delimiters } elseif (!preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z][A-Z.]{2,4}$/i',$_POST['email1'])) { Quote Link to comment https://forums.phpfreaks.com/topic/141080-solved-matching-email-with-regular-expression/#findComment-738389 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.