<?php 

$email = "email.com"; 
$email = preg_match("/[a-zA-Z@_-]/", $email); 
try 
{ 
    if (!$email) 
    { 
        throw new Exception("Email is not valid!"); 
    } else 
    { 
        return 1; 
    } 
} 
catch (exception $e) 
{ 
    echo "Error Message: <font color='red'>" . $e->getMessage() . "</font><br />"; 
    echo "The error is on line: <font color='red'>" . $e->getLine() . 
        "</font><br />"; 
    echo "The file the error is in: <font color='red'>" . $e->getFile() . 
        "</font><br />"; 
} 

?>