You are viewing a single comment's thread. Return to all comments →
public static int minimumNumber(int n, string password) { const int REQ_LENGTH = 6; int missing = 0; string[] tests = [ // lowercases @"[a-z]{1,}", // uppercases @"[A-Z]{1,}", // digits @"\d{1,}", // special characters @"[-!@#$%^&*()+]{1,}" ]; foreach (string test in tests) { if (!Regex.IsMatch(password, test)) { missing++; } }; return REQ_LENGTH - n > missing ? REQ_LENGTH - n : missing; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strong Password
You are viewing a single comment's thread. Return to all comments →