Regular Expression Pattern
^\+?1?[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$
Phone Number Regex Patterns

US Phone Number

^\+?1?[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$

China Mobile Number

^1[3-9]\d{9}$

International Format

^\+[1-9]\d{1,14}$
Pattern Breakdown

US Phone Number Pattern

^\+?1?Optional country code (+1)
[-. ]?Optional separator (dash, dot, or space)
\(?([0-9]{3})\)?Area code (3 digits) with optional parentheses
[-. ]?([0-9]{3})Exchange code (3 digits) with optional separator
[-. ]?([0-9]{4})$Subscriber number (4 digits) with optional separator

China Mobile Number Pattern

^1Must start with 1
[3-9]Second digit must be 3-9
\d{9}$Followed by exactly 9 more digits
Test Your Phone Number
Code Examples

javascript

// US Phone Number validation
const usPhoneRegex = /^\+?1?[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;

function validateUSPhone(phone) {
  return usPhoneRegex.test(phone);
}

// China Mobile Number validation
const chinaPhoneRegex = /^1[3-9]\d{9}$/;

function validateChinaPhone(phone) {
  return chinaPhoneRegex.test(phone);
}

// Usage examples
console.log(validateUSPhone("(555) 123-4567")); // true
console.log(validateChinaPhone("13812345678")); // true

python

import re

# US Phone Number pattern
us_phone_pattern = r'^\+?1?[-. ]?\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$'

def validate_us_phone(phone):
    return bool(re.match(us_phone_pattern, phone))

# China Mobile Number pattern
china_phone_pattern = r'^1[3-9]\d{9}$'

def validate_china_phone(phone):
    return bool(re.match(china_phone_pattern, phone))

# Usage examples
print(validate_us_phone("(555) 123-4567"))  # True
print(validate_china_phone("13812345678"))  # True

java

import java.util.regex.Pattern;

public class PhoneValidator {
    private static final String US_PHONE_PATTERN = 
        "^\\+?1?[-. ]?\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$";
    
    private static final String CHINA_PHONE_PATTERN = "^1[3-9]\\d{9}$";
    
    private static final Pattern usPattern = Pattern.compile(US_PHONE_PATTERN);
    private static final Pattern chinaPattern = Pattern.compile(CHINA_PHONE_PATTERN);
    
    public static boolean validateUSPhone(String phone) {
        return usPattern.matcher(phone).matches();
    }
    
    public static boolean validateChinaPhone(String phone) {
        return chinaPattern.matcher(phone).matches();
    }
    
    public static void main(String[] args) {
        System.out.println(validateUSPhone("(555) 123-4567")); // true
        System.out.println(validateChinaPhone("13812345678")); // true
    }
}
Test Cases
InputTypeExpectedDescription
(555) 123-4567US Format✓ ValidStandard US format with parentheses
555-123-4567US Format✓ ValidUS format with dashes
555.123.4567US Format✓ ValidUS format with dots
+1 555 123 4567US Format✓ ValidInternational US format
13812345678China Mobile✓ ValidChina mobile number
18987654321China Mobile✓ ValidChina mobile number starting with 189
15612345678China Mobile✓ ValidChina mobile number starting with 156
12345678901Invalid✗ InvalidInvalid China mobile (starts with 12)
555-12-4567Invalid✗ InvalidInvalid US format (wrong digit count)
abcd-efg-hijkInvalid✗ InvalidNon-numeric characters
Common Use Cases

User Registration Validation

Validate phone number format during user registration to ensure users enter valid phone numbers, providing a foundation for SMS verification and future contact.

// Registration form validation
if (!phoneRegex.test(userPhone)) {
  showError("Please enter a valid phone number");
}

SMS Verification

Validate phone number format before sending SMS verification codes to avoid sending failures due to format errors and improve delivery rates.

// SMS sending verification
const validPhones = phoneList.filter(phone =>
  phoneRegex.test(phone)
);

Customer Information Management

Validate and standardize customer phone numbers in CRM systems to ensure accuracy and consistency of customer contact information.

// Customer information validation
const cleanCustomers = customers.filter(customer =>
  phoneRegex.test(customer.phone)
);

International Applications

Validate phone numbers in different formats based on regions in international applications, supporting phone number validation needs across multiple countries and regions.

// International validation
const regex = country === 'US' ? usPhoneRegex :
  country === 'CN' ? chinaPhoneRegex : intlPhoneRegex;
Frequently Asked Questions

Why did my phone number validation fail?

Phone number validation usually fails due to format mismatch. Please ensure: Chinese phone numbers start with 1 and have 11 digits; US numbers can include area codes and separators; international numbers need country codes.

Chinese format: 13812345678, 18987654321
US format: (555) 123-4567, 555-123-4567, +1 555 123 4567
International format: +86 138 1234 5678, +1 555 123 4567

How to handle phone number formats from different countries?

Phone number formats vary greatly between countries. It's recommended to apply corresponding validation rules based on the user's selected country or region, or use internationalized phone number validation libraries.

Recommendation: For international applications, consider using professional libraries like libphonenumber to handle phone number formats from various countries.

What should I do after phone number validation passes?

Format validation is just the first step. In real applications, you also need to send SMS verification codes to confirm the authenticity of the phone number and user ownership.

// Complete phone number validation process
if (phoneRegex.test(phone)) {
  sendSMSVerification(phone);
}

How to handle formatted display of phone numbers?

It's recommended to store phone numbers in pure numeric format and add separators when displaying as needed. This facilitates data processing while providing a good user experience.