프론트엔드/Javascript
[Javascript] 전화번호 정규표현식
순코딩
2024. 1. 21. 11:01
arr="01012345678"
replaceArr = arr.replace(/(\d{3})(\d{4})(\d{4})/, "$1-$2-$3");
console.log(replaceArr); //010-1234-5761 반환