$re = '/^[a-zA-Z0-9]+([._+-][a-zA-Z0-9]+)*@[0-9a-zA-Z]+.[a-zA-Z]{2,4}+([.][a-zA-Z]{2,3})?$/m';
$str = 'valid
abc@yahoo.com
abc-100@yahoo.com
abc.100@yahoo.com
abc111@abc.com
abc-100@abc.net
abc.100@abc.com.au
abc@1.com
abc@gmail.com.com
abc+100@gmail.com
invalid
abc
abc@.com.my
abc123@gmail.a
abc123@.com
abc123@.com.com
.abc@abc.com
abc()*@gmail.com
abc@%*.com
abc..2002@gmail.com
abc.@gmail.com
abc@abc@gmail.com
abc@gmail.com.1a
abc@gmail.com.aa.au';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php