Regex for email validation

Hi

I’ve been searching the web for ages now and still cannot find a proper working perl regex to validate email addresses. Its kinda urgent so if you could help me that would be great!!
After playing around with bits i found i got this:


preg_match("/^[a-zA-Z0-9_.]+@[a-zA-Z0-9-]+.[a-zA-Z0-9]$/", $email)

which isnt working at all. As i said its pretty urgent so any help will be hugely appreciated!!

Thanks!

[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?

You can also use filter_var() with FILTER_VALIDATE_EMAIL (not FILTER_SANITIZE_EMAIL), which uses an RFC822 confirming regex.
(See that regex here: http://svn.php.net/viewvc/php/php-src/branches/PHP_5_2/ext/filter/logical_filters.c?view=markup&pathrev=297353#l525)