sms compliance
sms compliance
Cambodia Phone Number Validation: Complete +855 Format Guide
Master Cambodia phone number validation with regex patterns, E.164 formatting, operator prefixes, and code examples. Includes TRC-verified mobile codes and compliance requirements.
Cambodia Phone Number Validation: Complete +855 Format Guide
This guide provides comprehensive coverage of Cambodia phone number validation, equipping you with the knowledge and tools to integrate accurate phone number handling into your applications. You'll learn E.164 formatting standards, regex validation patterns, Cambodian mobile operator prefixes, area codes, best practices for data storage, and regulatory compliance requirements for the +855 country code.
Why Validate Cambodia Phone Numbers?
Correctly handling Cambodian phone numbers is crucial for several reasons:
- Reliable Communication: Accurate validation ensures your system connects with users reliably, preventing failed messages and calls.
- Data Integrity: Validated phone numbers contribute to a cleaner, more reliable database, improving data quality for analytics and other purposes.
- Regulatory Compliance: Adhering to Cambodian telecommunications regulations set by the Ministry of Posts and Telecommunications (MPTC) and the Telecommunication Regulator of Cambodia (TRC) is essential for operating legally and ethically.
- Enhanced User Experience: Validating phone numbers upfront prevents errors and streamlines the user journey.
Cambodia Phone Number Format and Structure
Cambodia's phone numbers adhere to the ITU-T E.164 international phone number format standard (E.164 11/10, effective November 2010). This standard defines a general format for international telephone numbers, ensuring global interoperability. The E.164 format limits phone numbers to a maximum of 15 digits, with the structure: [+][country code][area/operator code][subscriber number].
Cambodia Country Code: +855
-
Country Code: +855. This code uniquely identifies Cambodia in international calls. Prepend this to the number when dialing from outside Cambodia.
-
International Access Codes: Cambodia uses international access codes starting with 00, where the third digit identifies the operator's gateway. Currently active codes include:
- 001 – Gateway 1 (MPTC/Telecom Cambodia)
- 007 – Gateway 2 (Royal Telecam International)
- 008 – VoIP Gateway
These prefixes select a specific international gateway operator when making calls from within Cambodia. If your application handles calls originating from within Cambodia, consider offering users the option to select their preferred gateway.
National Prefix: 0
- National Prefix: 0. This prefix is used for domestic calls within Cambodia. Remove this prefix when converting a number to international format.
Cambodia Phone Number Formats by Type
Cambodian phone numbers fall into several categories: geographic (landline), mobile, and special service numbers.
Geographic Numbers (Landlines with Area Codes)
Geographic numbers are tied to specific regions within Cambodia. They follow this structure:
0[2-7]X XXXX XX(X)
Where the first two digits after the 0 represent the area code. Geographic numbers have 6 or 7 subscriber digits after the area code.
Cambodia Area Codes by Region:
- 02X prefix: Phnom Penh (023), Kandal (024), Kampong Speu (025), Kampong Chhnang (026)
- 03X prefix: Takeo (032), Kampot (033), Sihanoukville (034), Koh Kong (035), Kep (036)
- 04X prefix: Kampong Cham (042), Prey Veng (043), Svay Rieng (044)
- 05X prefix: Pursat (052), Battambang (053), Banteay Meanchey (054), Pailin (055)
- 06X prefix: Kampong Thom (062), Siem Reap (063), Preah Vihear (064), Oddar Meanchey (065)
- 07X prefix: Kratie (072), Mondulkiri (073), Stung Treng (074), Ratanakiri (075)
Validate area codes against the official TRC allocation list at trc.gov.kh to ensure accuracy.
Example: 023 123 4567 (Phnom Penh) → +855 23 1234567 (international format)
Mobile Numbers (Operator Prefixes)
Mobile numbers vary by operator and follow this general format:
0TT XXX XXX(X)
Mobile numbers have 8 or 9 digits total (including the leading 0). The first two digits after the 0 identify the mobile operator. Most operators use 8-digit numbers (7 subscriber digits), but some use 9-digit numbers (8 subscriber digits).
Current Cambodia Mobile Operator Prefixes (verified via TRC Mobile Prefixes, accessed January 2025):
- Cellcard: 011, 012, 014, 017, 061, 076*, 077, 078, 085, 089, 092, 095, 099
- Metfone: 031*, 060, 066, 067, 068, 071*, 088*, 090, 097*
- Seatel: 018*
- Smart: 010, 015, 016, 069, 070, 081, 086, 087, 093, 096*, 098
- CooTel: 038
- qb: 013, 080, 083, 084
Note: Prefixes marked with * indicate 7-digit subscriber numbers (10 digits total including 0). All other prefixes use 6-digit subscriber numbers (9 digits total including 0).
Important: Operator prefixes may change as new allocations are made. Verify current prefixes with the TRC (trc.gov.kh/en/resources/mobile-prefixes/) for the most up-to-date information.
Examples:
- 012 345 678 (Cellcard, 8 digits) → +855 12 345678 (international)
- 076 234 5678 (Cellcard, 9 digits) → +855 76 2345678 (international)
Special Service Numbers
These include toll-free (1800 XXXX) and premium-rate (1900 XXXX) numbers. These numbers have specific uses and billing structures, so identify them correctly in your validation logic.
How to Validate Cambodia Phone Numbers Using Regex
Regular expressions (regex) provide a powerful way to validate Cambodia phone number formats. Here are production-ready patterns based on TRC specifications.
JavaScript Regex Validation Examples
// Geographic Number Validation (6 or 7 digits after area code)
const geoPattern = /^0[2-7]\d{7,8}$/;
console.log(geoPattern.test('0231234567')); // true (7 digits)
console.log(geoPattern.test('023123456')); // true (6 digits)
// Mobile Number Validation (8 or 9 digits total including leading 0)
const mobilePattern = /^0(1[0-8]|3[18]|6[0-179]|7[0-18]|8[0-8]|9[0-38])\d{6,7}$/;
console.log(mobilePattern.test('012345678')); // true (8 digits)
console.log(mobilePattern.test('0762345678')); // true (9 digits)
// International Format Validation (with +855 country code)
const internationalPattern = /^\+855[1-9]\d{7,8}$/;
console.log(internationalPattern.test('+85512345678')); // trueImportant: These regex patterns are based on current TRC allocations. Test your regex thoroughly with a variety of valid and invalid numbers. Some operators use longer subscriber numbers or have specific digit patterns.
Complete Phone Number Validation Function
A robust validation function should handle various scenarios, including cleaning the input and providing informative error messages.
function validateCambodianNumber(number) {
const cleanNumber = number.replace(/\s+/g, ''); // Remove whitespace
const geoPattern = /^0[2-7]\d{7,8}$/;
const mobilePattern = /^0(1[0-8]|3[18]|6[0-179]|7[0-18]|8[0-8]|9[0-38])\d{6,7}$/;
if (!mobilePattern.test(cleanNumber) && !geoPattern.test(cleanNumber)) {
throw new Error('Invalid Cambodian phone number format');
}
return cleanNumber;
}Converting Cambodia Numbers to E.164 International Format
For international calls or data storage, convert numbers to E.164 international format by removing the national prefix (0) and prepending the country code (+855).
function toInternationalFormat(number) {
const cleanNumber = number.replace(/^0/, ''); // Remove leading 0
return `+855${cleanNumber}`;
}
// Example usage
console.log(toInternationalFormat('012345678')); // Output: +85512345678
console.log(toInternationalFormat('023 123 4567')); // Output: +855231234567How to Store Cambodia Phone Numbers in a Database
Store Cambodian phone numbers in your database using a VARCHAR field with a length of 15 characters to accommodate the E.164 international format and any potential extensions. Consider storing the phone number type (mobile, geographic, etc.) to facilitate filtering and analysis. Implement encryption for stored numbers to comply with data privacy regulations. For additional verification needs, consider integrating a phone lookup service to validate number ownership and carrier information.
CREATE TABLE user_contacts (
id SERIAL PRIMARY KEY,
phone_number VARCHAR(15),
phone_type ENUM('mobile', 'geographic', 'toll-free', 'premium'),
operator_name VARCHAR(50),
is_verified BOOLEAN DEFAULT FALSE,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);Error Handling and User Feedback
Provide clear and user-friendly error messages when validation fails. Guide users on how to correct their input. For example, if a user enters an invalid operator prefix, display a message like "Invalid operator prefix. Check your number and try again."
Cambodia Phone Number Regulations and Data Privacy Compliance
Current Regulatory Status (as of January 2025):
Cambodia has not yet enacted comprehensive data protection legislation. The Ministry of Posts and Telecommunications (MPTC) released a draft Law on Personal Data Protection (LPDP) for consultation on July 25, 2023, but it has not progressed to enactment. The draft law's scope is limited to the private sector and does not apply to public authorities.
Current Legal Framework:
Data protection currently falls under the right to privacy, protected broadly under:
- Constitution of the Kingdom of Cambodia (2010)
- Civil Code of the Kingdom of Cambodia (2007)
- Criminal Code of the Kingdom of Cambodia (2009)
- Banking Law and other sector-specific regulations
Key Regulatory Bodies:
- MPTC: Ministry of Posts and Telecommunications (mptc.gov.kh)
- TRC: Telecommunication Regulator of Cambodia (trc.gov.kh)
Best Practice Requirements:
Until comprehensive data protection legislation is enacted, follow these best practices:
- Obtain explicit user consent for phone number collection
- Implement encryption for stored phone numbers
- Maintain secure data handling practices
- Provide users with data access and deletion rights
- Keep records of consent and data processing activities
- Monitor for updates to the draft LPDP and prepare for compliance once enacted
Advanced Implementation Tips
- Network Detection and Routing: Use the operator prefix to determine the network and apply carrier-specific routing rules. This optimizes call routing and improves call quality.
- Operator Updates: Operator prefixes and number formats can change. Stay updated with the latest information from the TRC at trc.gov.kh/en/resources/mobile-prefixes/ to ensure your validation logic remains accurate. Check the TRC website quarterly for updates.
- Number Portability: Be aware that mobile number portability may allow users to keep their numbers when switching operators. The prefix may not always accurately reflect the current operator.
Frequently Asked Questions (FAQ)
What is the country code for Cambodia?
The country code for Cambodia is +855. When dialing from outside Cambodia, dial +855 followed by the area code (without the leading 0) and the subscriber number. For example, to call a Phnom Penh landline (023 123 4567) from the United States, dial: 011 (US exit code) + 855 (Cambodia) + 23 1234567.
How do I format a Cambodia phone number in E.164 format?
To format a Cambodia phone number in E.164 format, remove the leading 0 from the domestic number and prepend +855. For example, 012 345 678 becomes +85512345678. The E.164 format contains no spaces or special characters.
What are the main mobile operators in Cambodia?
The main mobile operators in Cambodia are Cellcard, Smart, Metfone, qb, Seatel, and CooTel. Each operator has specific prefix allocations that can be verified on the TRC website.
How many digits are in a Cambodia mobile phone number?
Cambodia mobile phone numbers contain 8 or 9 digits total, including the leading 0. This equals 7 or 8 subscriber digits after the operator prefix. Most operators use 8-digit numbers, but some prefixes (like 076, 096) use 9 digits.
How do I validate a Cambodia phone number in JavaScript?
Use regex patterns to validate Cambodia phone numbers:
const mobilePattern = /^0(1[0-8]|3[18]|6[0-179]|7[0-18]|8[0-8]|9[0-38])\d{6,7}$/;
const isValid = mobilePattern.test('012345678'); // Returns true/falseWhat is Cambodia's national prefix?
Cambodia's national prefix is 0. It's used for domestic calls within Cambodia but must be removed when converting to international format.
Where can I verify Cambodia mobile operator prefixes?
Official Cambodia mobile operator prefixes are published by the Telecommunication Regulator of Cambodia (TRC) at trc.gov.kh/en/resources/mobile-prefixes/. The list is updated as new allocations are made. Always verify against the TRC's official list for the most current and accurate prefix allocations.
Are there data privacy requirements for storing Cambodia phone numbers?
While Cambodia has not yet enacted comprehensive data protection legislation as of January 2025, you should still follow best practices: obtain explicit user consent, implement encryption, maintain secure data handling, and provide data access and deletion rights to users. Treat phone numbers as personally identifiable information (PII) and implement appropriate security measures.
Summary
By following these guidelines, you ensure accurate and reliable Cambodia phone number handling in your applications, enhancing user experience and maintaining regulatory compliance. Remember to validate numbers using TRC-verified operator prefixes, convert to E.164 format for storage, and stay updated on regulatory changes from MPTC and TRC.