Codewars: Regex Password Validation

5kyu的一道题。 简单考察正则表达式语法。前向断言。

You need to write regex that will validate a password to make sure it meets the following criteria:

At least six characters long
contains a lowercase letter
contains an uppercase letter
contains a number
Valid passwords will only be alphanumeric characters.


reg = r'(?=.\*[A-Z].\*)(?=.\*[a-z].\*)(?=.\*\d.\*)[a-zA-Z0-9]{6,}'

猜你喜欢

转载自blog.csdn.net/qq_35279914/article/details/82192749