hasMinNormalChar method

bool hasMinNormalChar(
  1. String password,
  2. int normalCount
)

Checks if password has at least normal char letter matches

Implementation

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