Skip to content

Instantly share code, notes, and snippets.

@thatswiftguy
Created May 19, 2021 09:34
Show Gist options
  • Save thatswiftguy/d82c2135901d4d9babab00ab94be40e7 to your computer and use it in GitHub Desktop.
Save thatswiftguy/d82c2135901d4d9babab00ab94be40e7 to your computer and use it in GitHub Desktop.
let pass = NSPredicate(format: "SELF MATCHES %@ ", "^(?=.*[a-z])(?=.*[$@$#!%*?&])(?=.*[A-Z]).{6,}$")
pass.evaluate(with: "SomStrin&&") // true
pass.evaluate(with: "nononnsdf") // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment