( # Start of group
(?=.*\d) # must contain at least one digit
(?=.*[A-Z]) # must contain at least one uppercase character
(?=.*[a-z]) # must contain at least one lowercase character
(?=.*\W) # must contain at least one special symbol
\w
. # match anything with previous condition checking
{6,18} # length is characters
\w
) # End of group
1 回答
这并不难:
在一行中:
如果您不喜欢
\w
等于[a-zA-Z0-9_]
,请将其替换为该组并删除下划线 .但是,我完全支持ctwheels的论点 .