string inputText = textBox1.

Text;
if (Regex.IsMatch(inputText,
@"^(?("")("".+?""@)|(([0-9a-zA-Z]((\.(?!\.))|[-!#\$%&'\*\+/=\?
\^`\{\}\|~\w])*)(?<=[0-9a-zA-Z])@))" +
@"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-zA-Z][-\w]*[0-9a-z
A-Z]\.)+[a-zA-Z]{2,6}))$"))
{
MessageBox.Show("yes");
}
else
{
MessageBox.Show("no");
}

Sign up to vote on this title
UsefulNot useful