I have a password match requirment where I do not want to include German umlaut in password validation. Current match criteria is:
- one lower case
- one upper case
- One digit
- minimum 10 chars
I created a regex as below:
func matchPasswordWith(_ text: String) -> Bool {
let predicate = NSPredicate(format: "SELF MATCHES %@","^(?=.*?[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{10,}$")
return predicate.evaluate(with: text)
}
But when a user enters any umlaut (e.g. ü, ä, Ä, ß), the above regex returns true but I want to exclude umlaut match.
Please suggest what am I doing wrong here.