Fix: MaestroID include korean word, 3+ alphabet count

This commit is contained in:
2022-05-01 23:04:41 +09:00
parent 5a5d2d97a3
commit 3922076ae7
+5 -5
View File
@@ -1,5 +1,5 @@
function AccountValidator() {
this.patternMaestroID = /^[A-Za-z가-힣]{1}[A-Za-z0-9가-힣]{3,19}$/;
this.patternMaestroID = /^[A-Za-z가-힣]{1}[A-Za-z0-9가-힣]{2,19}$/;
this.patternMaestroPW = /^[A-Za-z0-9]{4,16}$/;
this.patternPlayerID = /^[A-Za-z0-9가-힣-_]{1,8}$/;
@@ -24,10 +24,10 @@ AccountValidator.prototype.messageForInvalidMaestroID = function(textID) {
return "마에스트로 계정명은 " + AccountValidator.MAESTRO_ID_LENGTH_MINIMUM + "글자 이상이어야 합니다.";
else if(textID.length > AccountValidator.MAESTRO_ID_LENGTH_MAXIMUM)
return "마에스트로 계정명은 " + AccountValidator.MAESTRO_ID_LENGTH_MAXIMUM + "글자 이하이어야 합니다.";
else if(!(/^[A-Za-z]/.test(textID)))
return "마에스트로 계정명은 알파벳로 시작해야 합니다.";
else if((/[^\w]/g).test(textID))
return "마에스트로 계정명은 알파벳 숫자로만 적어주세요.";
else if(!(/^[A-Za-z가-힣]/.test(textID)))
return "마에스트로 계정명은 알파벳이나 한글로 시작해야 합니다.";
else if(!(/[^[A-Za-z0-9가-힣]]/g).test(textID))
return "마에스트로 계정명은 알파벳이나 한글, 숫자로만 적어주세요.";
}