In PHP I am using the following code…
$passwordCapitalLettersLength = strlen(preg_replace("![^A-Z]+!", "", $password));
$passwordNumbersLength = strlen(preg_replace("/[0-9]/", "", $password));
…to count how many times capital letters and numbers appear in the password.
What is the equivalent of this in Objective C?
You can use the
NSCharacterSet: