1
$password = 'pwd3000!';
if(!preg_match('/^(?=.{4,31}$)(?!.*(.)\1{4}). \w[\w.-]+\w$/', $password)){
echo 'Your password is too easy';
} else {
echo 'Your password is strong';
}
如果密碼有4個以上重複字符,我想回顯'您的密碼太簡單了'。防止在密碼中重複字符
現在,當我運行代碼時,我得到'您的密碼太簡單了'。但它只有3個重複的字符串,而不是4.我該如何解決這個問題?
可能dublicate http://stackoverflow.com/questions/20770148/how-to-prevent-the-user-from-repeating -a-character-more-three-times-in-the –
過濾出重複的字符或*連續的*重複的字符? – castis
@castis連續 – brewpixels