I am trying to localize an existing app that has the following logic that tries to validate a password text box. I'm assuming that this will not work with languages with special characters that the user could type in the text box. Am I correct? I don't think that we want to restrict the user from typing non-English-type characters (i.e. arabic, chinese, etc.). Or, is there something I'm not understanding?
Regex ValidHex =
new Regex("[A-Za-z1234567890_-]+", RegexOptions.IgnoreCase);
if (!ValidHex.IsMatch(e.Text))
{
e.Handled = true;
}