Java

[ java ] 자바 정규식, 참고 블로그, 숫자, 전화번호

JooKit 주킷 2020. 12. 30. 19:40
목차 접기
728x90
반응형

https://highcode.tistory.com/6

http://blog.daum.net/question0921/419

public static String getMobileNumberFormat(String mobile)
    {
        String regEx = "(\\d{3})(\\d{3,4})(\\d{4})";

        mobile = mobile.replaceAll(regEx, "$1-$2-$3");

        return mobile;
    }
728x90
반응형
LIST