REGEXVAULTv2.0
Localization/Phone Numbers
Verified Safe

Japanese Phone Number Regex for PHP

/^(?:(?:\+81[\s.-]?|0)(?!0)(?=[0-9\s.-]{10,13}$)(?:[1-9][0-9]{0,3}[\s.-]?[0-9]{2,4}[\s.-]?[0-9]{4})|(?:\+81[\s.-]?|0)(?!0)(?:[1-9][0-9]{3}[\s.-]?[0-9]{1,2}[\s.-]?[0-9]{4}))$/

What this pattern does

This page provides a comprehensive, battle-tested regular expression for matching japanese phone number, ported and verified for PHP. A rigorously tested regex reduces debugging time and protects your application from edge-case failures. The snippet below is ready to drop into your PHP project — whether you're validating in a Laravel validator, a WordPress plugin, or a standalone PHP script.

Php Implementation

Php
<?php
// Japanese Phone Number
// ReDoS-safe | RegexVault — Localization > Phone Numbers

define('JAPANESE_PHONE_NUMBER_PATTERN', '/^(?:(?:\+81[\s.-]?|0)(?!0)(?=[0-9\s.-]{10,13}$)(?:[1-9][0-9]{0,3}[\s.-]?[0-9]{2,4}[\s.-]?[0-9]{4})|(?:\+81[\s.-]?|0)(?!0)(?:[1-9][0-9]{3}[\s.-]?[0-9]{1,2}[\s.-]?[0-9]{4}))$/');

function validate_japanese_phone_number(string $input): bool {
    return (bool) preg_match(JAPANESE_PHONE_NUMBER_PATTERN, $input);
}

// Example
var_dump(validate_japanese_phone_number("+81 3 1234 5678")); // bool(true)

Test Cases

Matches (Valid)
Rejects (Invalid)
+81 3 1234 5678+81 0 1234 5678
03-1234-5678031234567
+8190-1234-5678+82 3 1234 5678
090-1234-567803-12345-5678
+81 3-1234-5678

When to use this pattern

This pattern is drawn from the Localization > Phone Numbers category and carries a ReDoS-safe certification. That matters for PHP developers because especially relevant in PHP where PCRE backtracking limits can trigger silent failures on malicious input. RegexVault audits patterns against known backtracking attack vectors, ensuring you have the necessary context before using this regex in a high-stakes production environment.

Common Pitfalls

Japanese phone numbers display with hyphens in three groups. Mobile (090-XXXX-XXXX) and landline (03-XXXX-XXXX) have different group sizes. Preserve the grouping format in display.

Technical Notes

Japanese area codes: 03 (Tokyo), 06 (Osaka), 011 (Sapporo). Mobile numbers start with 070, 080, 090 (in domestic format). IP phone (050). +81 replaces the leading 0. Total 10-11 digits.

Have a pattern that belongs in the vault?

Submit it for review — community-verified patterns get credited to your GitHub handle. Free submissions join the queue. Priority review available for $15.

Submit a Pattern