so i have this piece of code and what i need help with is:
i need it to not allow spaces (e.g user 123@hotmail.com
= invalid)
i need it to allow all characters except the !
character.
i need the domain (after .
) that if more than 2 characters long, must be validated by a supplied file which i have here.
the country codes are. AERO, BIZ, COM, COOP, EDU, GOV, INFO, INT, MIL, MUSEUM, NAME, NET, ORG, PRO
current code.
private void validateBtn_Click(object sender, EventArgs e)
{
Regex email = new Regex(@"[a-zA-Z0-9]{1,20}@[a-zA-Z0-9]{1,20}\.[a-zA-Z]{2,3}$");
if (!email.IsMatch(emailTxt.Text))
{
validLbl.Text = "Email invalid";
}
else
{
validLbl.Text = "Email Valid";
}
}
any help would be awesome! :D i just cant find any resources to help me.