Uhhh... something like ereg("[_a-zA-Z\-]+\@[\.a-zA-Z\-]+\.com",$variable);
SHOULD work... If you want to make sure they're @domain.com instead of any domain, try... ereg("[_a-zA-Z\-]+\@[\.a-zA-Z\-]+domain\.com",$variable); if you want to validate e-mail address formats, there is (if memory serves) a discussion in the comments on php.net/eregi of how to do this best. > I need to check a variable to see if the format fits one > of the following: > > [EMAIL PROTECTED] > or > *@domain.com > or > *@*.domain.com > > How can I do this with regex? Any help would be greatly > appreciated. > > Devin Atencio -- And in knowing that you know nothing, that makes you the smartest of all. Socrates -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php