I didn't understand what do you mean with pattern. This is my code:
function tep_validate_email($email) {
$valid_address = true;
$mail_pat = '^(.+)@(.+)$';
$valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
$atom = "$valid_chars+";
$quoted_user='(\"[^\"]*\")';
$word = "($atom|$quoted_user)";
$user_pat = "^$word(\.$word)*$";
$ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
$domain_pat = "^$atom(\.$atom)*$";
//if (eregi($mail_pat, $email, $components)) {
if (preg_match($mail_pat, $email, $components)) {
$user = $components[1];
$domain = $components[2];
// validate user
//if (eregi($user_pat, $user)) {
if (preg_match($user_pat, $user)) {