if (!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]{1,})+)*$",trim($_POST['email']))) { // email is wrong }