0
25th Jan 2020, 2:09 PM
Kanyanta Makasa
Kanyanta Makasa - avatar
2 Respostas
+ 1
It seems you have problem in your regular expression. regex is very powerful tool and you can even make all your checks within one expression like This: regex="^.*(?=.{7,})(=?.*[a-zA-Z])(?=.*\d)(?=.*[!@#$%&*]).*
quot; ''' ^.* : Start of string (?=.{7,}) : Length (?=.*[a-zA-Z]) : Letters (?=.*\d) : Digits or more obvious [0-9] (?=.*[!@#$%&*]) : Special characters .*$ : End of string ''' . It may be complex but it works fine.
25th Jan 2020, 4:11 PM
Oleksandr Gorlinskyi
Oleksandr  Gorlinskyi - avatar
0
Try using re.findall(r'0-9'... For digits and re.findall(r'\W'...for special characters. This returns a list that you can check the length of. So if Len(input) > 6 and Len(digit) > 1 and Len(spe_char) > 1 it's strong.
27th Jan 2020, 12:55 PM
Onuoha_ifeanyi
Onuoha_ifeanyi - avatar