修正密码格式验证

This commit is contained in:
free will committed 2021-08-06 19:54:40 +08:00
1 parent 3b44af3153
commit bb7f18307f
6 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -42,8 +42,8 @@ android {
applicationId "com.pkusz.min_vpn_client"
minSdkVersion 24
targetSdkVersion 30
versionCode 4
versionName "4.0.0"
versionCode 2
versionName "2.0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -141,12 +141,12 @@ public class RegisterActivity extends MINVpnBaseActivity<RegisterActivityPresent
return;
}
if(!AccountValidatorRegexUtil.INSTANCE.isPassword(password)){
showWarning("请输入有效的密码,密码为8-16位,必须包含大小写字母和特殊符号");
showWarning("请输入有效的密码,密码为8-20位,必须包含大小写字母和特殊符号");
btnRegister.revertAnimation();
return;
}
if(!AccountValidatorRegexUtil.INSTANCE.isPassword(rePassword)){
showWarning("请输入有效的密码,密码为8-16位,必须包含大小写字母和特殊符号");
showWarning("请输入有效的密码,密码为8-20位,必须包含大小写字母和特殊符号");
btnRegister.revertAnimation();
return;
}
@@ -15,7 +15,7 @@ object AccountValidatorRegexUtil {
/**
* 正则表达式:验证密码
*/
val REGEX_PASSWORD = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[\$@\$!%*.#?&])[A-Za-z\\d\$@\$!%*.#?&]{8,20}\$"
val REGEX_PASSWORD = "^(?=.*[A-Za-z])(?=.*\\d)(?=.*[\$@\$!%*.#?&])[A-Za-z\\d\$@\$!%*.#?&]{7,21}\$"
/* val REGEX_PASSWORD1 = "^((?![a-z]+$)(?![A-Z]+$)(?!\\d+$)(?![!@#$%^&*._-]+$)(?![a-zA-Z\\d]+$)(?![a-zA-Z!@#$%^&*._-]+$)(?![\\d!@#$%^&*._-]+$)[a-zA-Z\\d!@#$%^&*._-]+){8,20}$"
val REGEX_PASSWORD2 = ".*[A-Z]+.*"
BIN
View File
Binary file not shown.