hasMinimumUppercase method

bool hasMinimumUppercase(
  1. String password,
  2. int uppercaseCount
)

Implementation

bool hasMinimumUppercase(String password, int uppercaseCount) {
  String pattern = '^(.*?[A-Z]){' + uppercaseCount.toString() + ',}';
  return password.contains(RegExp(pattern));
}