Its syntax is: int ereg(string pattern, string string, [array regs]) The search is case sensitive in regard to alphabetical characters. Use ereg() to search strings for .com domains: <? $email="a@a.com"; $is_com = ereg("(\.)(com$)", $email); print $is_com; ?>