Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- RT scheduling
- GraphQL
- 해시테이블
- 프론트엔드
- RxJS
- C
- 스택
- cors
- Machine Learning
- pytorch
- 큐
- 포인터
- 브라우저
- 웹팩
- 타입스크립트
- 배열
- vue3
- 프로세스
- 릿코드
- 자료구조
- 코딩테스트
- 이진탐색
- 연결리스트
- 연결 리스트
- 자바스크립트
- 프로그래머스
- 알고리즘
- 컨테이너
- APOLLO
- alexnet
Archives
- Today
- Total
목록Regex (1)
프린세스 다이어리
자바스크립트 전화번호/휴대폰번호 정규표현식, 의미 설명
1. 전체 거의 웬만한 국내 개인/업체 전화번호는 포맷팅 가능할듯. 물론 5자리 통신사 번호 같은 레어템은 안 침. const formatPhoneNumber = (str: string) => { if (typeof str !== 'string') return ''; str = str.replace(/[^0-9]/g, ''); if (str.indexOf('82') == 0) { return str.replace(/(^82)(2|\d{2})(\d+)?(\d{4})$/, '+$1-$2-$3-$4'); // +82 } else if (str.indexOf('1') == 0) { return str.replace(/(^1\d{3})(\d{4})$/, '$1-$2'); // 1588, 1566, 1677, ....
FE
2022. 1. 24. 23:03