I have some code that checks a fields input against a regex, although for some reason (no matter what I put in the field, it returns flase. Is there something I have missed?
private void textBox5_Validating(object sender, CancelEventArgs e)
{
String AllowedChars = @"^a-zA-Z0-9.$";
if (Regex.IsMatch(textBox5.Text, AllowedChars))
{
MessageBox.Show("Valid");
}
else
{
MessageBox.Show("Invalid");
}
}