I always use this to verify an email address is properly formatted
PHP Code:
preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)
With $email being the address to be verified.
I think it will work in what you're looking for, it'll find it anyway, but you need to also extract it, so i suggest using:
PHP Code:
preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email, $matches)
Where $matches is a variable, so you would want $matches[0] I THINK! i'm not totally sure as i've never needed to extract an address, check out the PHP manual about the preg_match() function
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill
Please visit my sites: Please login or register to view this content. Registration is FREE | Please login or register to view this content. Registration is FREE
|