using System.Text.RegularExpressions;
public static void Main()
String[] inputs = new String[] {
"1234567890123456789123",
"zxcvbnmasdfghjklqwerty",
"ZXCVBNMASDFGHJKLQWERTY",
foreach(string input in inputs)
private static readonly Regex Pattern = new Regex(@"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z])\S{8,16}$", RegexOptions.Compiled);
public static void Test(string input)
Match match = Pattern.Match(input);
Console.WriteLine(input + " : " + match.Success);