~/devtools / regex / phone
tool::regex-guide

regex phone

/^\+?[\d\s\-\(\)]{7,15}$/

전화번호 검증

ad · 728×90
정규식 패턴
/^\+?[\d\s\-\(\)]{7,15}$/
플래그:없음
패턴 분석
^Start of string
\+?Optional leading + (international prefix)
[\d\s\-\(\)]Digit, space, dash, or parenthesis
{7,15}Between 7 and 15 characters total
$End of string
매칭 예시
+1 800 555 0100
0800-555-0100
(555) 123-4567
07911123456
비매칭 예시
abc-def-ghij
123
++1234567890
1234567890123456

국제 전화번호를 포함한 다양한 형식의 전화번호를 검증하는 패턴입니다. +국가코드, 공백, 하이픈, 괄호 등 흔히 사용되는 구분자를 허용하며, 7~15자리 길이 제한으로 E.164 표준 범위를 커버합니다.

언어별 사용법

JavaScriptRegExp 객체 또는 리터럴 사용
const pattern = /^\+?[\d\s\-\(\)]{7,15}$/;

// Test a string
console.log(pattern.test("+1 800 555 0100")); // true
console.log(pattern.test("abc-def-ghij")); // false

// Match and extract
const result = "+1 800 555 0100".match(pattern);
Pythonre 모듈 사용
import re

pattern = r"^\+?[\d\s\-\(\)]{7,15}$"

# Test a string
if re.fullmatch(pattern, "+1 800 555 0100"):
    print("Valid")

# Find all matches in text
matches = re.findall(pattern, text)
Javajava.util.regex 패키지 사용
import java.util.regex.*;

String pattern = "^\\+?[\\d\\s\\-\\(\\)]{7,15}$";
Pattern p = Pattern.compile(pattern);

Matcher m = p.matcher("+1 800 555 0100");
boolean isValid = m.matches(); // true

// Find occurrences
Matcher finder = p.matcher(inputText);
while (finder.find()) {
    System.out.println(finder.group());
}

주요 사용 사례

  • 회원가입 전화번호 입력 유효성 검증
  • CRM 시스템 연락처 데이터 정제
  • SMS 발송 전 번호 형식 확인
  • 글로벌 서비스의 다국가 전화번호 처리
  • 주문 폼 연락처 필드 검증

관련 패턴

email/^[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-/iurl/^https?:\/\/[^\s\/$.?#].[^\s]*$/iip-address/^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\./date/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[/
ad · 300×250
Regex 테스터로 돌아가기
// related tools
Cron 표현식 생성기
Cron 표현식을 시각적으로 만들고 파싱합니다. 사람이 읽기 쉬운 설명과 다음 실행 시간을 미리 확인할 수 있습니다.
jwt
JWT 디코더
JWT 토큰을 디코딩하고 분석합니다. 헤더, 페이로드, 서명을 확인할 수 있습니다.
색상 변환기
HEX, RGB, HSL 등 다양한 형식으로 색상을 변환합니다.
ts
타임스탬프 변환기
Unix 타임스탬프와 날짜/시간을 양방향으로 변환합니다. ms/s, UTC/로컬, 상대 시간을 지원합니다.