Null , Length 체크 하지 않고, 한방에 해결~ 다들 알고 있겠지만~ 자꾸 까먹는 저를 위해~~ String phoneNo = "01028614444"; String regEx = "(\\d{3})(\\d{3,4})(\\d{4})"; if(Pattern.matches(regEx, phoneNoStr)) { phoneNo = phoneNo.replaceAll(regEx, "$1-$2-$3"); }