private bool ChekIfPolicyWorks(PasswordPolicyDay2a policy) { var result = Regex.Matches(policy.Password, policy.Letter); var checkResult = CheckResult(result, policy); return(checkResult); }
private bool CheckResult(MatchCollection matches, PasswordPolicyDay2a policy) { return(matches.Count <= policy.MaxOccurences && matches.Count >= policy.MinOccurences); }