Groups in regex to validate password

Iterate the string, count the used characters per group and compare against your threshlds.