Home » Android » android – Password Regex Kotlin-Exceptionshub

android – Password Regex Kotlin-Exceptionshub

Posted by: admin February 26, 2020 Leave a comment

Questions:

Can anyone help me, please tell me what is wrong in this regex.
When I run the code, there is no validation error even after I am entering password against the regex ??

val pass_pattern = """^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[@#${'$'}%!\-_?&])(?=\S+${'$'}).{6,}""".toRegex()

this is the validation code

 else if (pass_pattern.matches(pass.toString())){
        pass.error = "Weak Password"
        return false
    }
How to&Answers: