using System.Text.RegularExpressions;
public static void Main()
var rgxPasswordPattern = new Regex("\\b(?=.*?[A-Z])(?=.*?[0-9]).{6,}\\b");
var result = rgxPasswordPattern.IsMatch("Password1");
Console.Write("Password match!");
Console.Write("Password doesn't match!");