Skip to content

Commit f182641

Browse files
authored
Merge pull request #331 from EAT-SSU/fix/#330-nickname-validation
fix: λ‹‰λ„€μž„ μ–‘ 끝단 숫자 ν—ˆμš©
2 parents 0bccc08 + 4ecb3af commit f182641

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

β€Žsrc/main/java/ssu/eatssu/domain/user/util/NicknameValidator.javaβ€Ž

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ public void validateNickname(String nickname){
102102
throw new BaseException(BaseResponseStatus.CONSECUTIVE_HYPHEN_NICKNAME);
103103
}
104104

105-
// ν•œκΈ€ μ˜μ–΄κ°€ μ•„λ‹Œ κ²ƒμœΌλ‘œ μ‹œμž‘
106-
if (nickname.matches("^[^A-Za-zκ°€-νž£γ„±-γ…Žγ…-γ…£].*")) {
105+
// ν•œκΈ€, μ˜μ–΄, μˆ«μžκ°€ μ•„λ‹Œ κ²ƒμœΌλ‘œ μ‹œμž‘
106+
if (nickname.matches("^[^A-Za-zκ°€-νž£γ„±-γ…Žγ…-γ…£0-9].*")) {
107107
throw new BaseException(BaseResponseStatus.INVALID_START_OF_NICKNAME);
108108
}
109109

110-
// ν•œκΈ€ μ˜μ–΄κ°€ μ•„λ‹Œ κ²ƒμœΌλ‘œ 마무리
111-
if (nickname.matches(".*[^A-Za-zκ°€-νž£γ„±-γ…Žγ…-γ…£]$")) {
110+
// ν•œκΈ€, μ˜μ–΄, μˆ«μžκ°€ μ•„λ‹Œ κ²ƒμœΌλ‘œ 끝남
111+
if (nickname.matches(".*[^A-Za-zκ°€-νž£γ„±-γ…Žγ…-γ…£0-9]$")) {
112112
throw new BaseException(BaseResponseStatus.INVALID_END_OF_NICKNAME);
113113
}
114114

0 commit comments

Comments
Β (0)