嘿,我只是想检查一个字符串是否包含大写字符。
所以我要检查一下:
$password = "alllowercaseisnotenough"
#check if UpperCase Letter is Contained:
if($password -match '.*[A-Z].*'){
Write-Host "+ Password has UpperCase Character[s]"
} else {
Write-Host "- Password has no UpperCase Character[s]"
}
问题是它说“ +密码具有大写字母”,有人可以解释为什么此检查不起作用吗?