Skip to content

PwdRegex

By using PwdRegex , you can check if the password strength meets the requirements.

Quick start

Version 0.5.2

"852Vast.".isPwd(RwdStrength3)

Password strength

Default value

Version 0.5.2

Four password strength are provided by default:

  • PwdStrength1:Password contains at least one letter and one number.
  • PwdStrength2:Password contains at least one uppercase letter, one lowercase letter and one number.
  • PwdStrength3:Password contains at least one letter, one number and one special character.
  • RwdStrength4:Password contains at least one uppercase letter, one lowercase letter, one number and one special character.

Special character

Special character include !@#$%^&*.

Customize password strength

Version 0.5.2

By implementing PwdStrength , you can customize the expression corresponding to the password strength, for example:

object YourRwdStrength : PwdStrength {
    override val regex: String
        get() = "(?=.*[A-Z])(?=.*[a-z])(?=.*\\d)(?=.*[!@#\\\$%\\^&\\*\\.])."
}

Common combination shielding

Version 0.5.2

isPwd provides the parameter shouldNotAppear, through which you can specify combinations that should not appear in the password, for example:

"852admin".isPwd(RwdStrength3, shouldNotAppear = arrayOf("123","admin"))

Sample code

Sample code