public static bool IsValidPassword (string input)
{
Match match = Regex.Match(input, @"(?=^.{8,12}$)((?=.*\d)(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[^A-Za-z0-9])(?=.*[a-z])|(?=.*[^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])|(?=.*\d)(?=.*[A-Z])(?=.*[^A-Za-z0-9]))^.*");
if (match.Success && match.Index == 0 && match.Length == input.Length)
return true;
else
return false;
}