Japanese post code validation

Set Japanese post code validation.
Please check following site.
https://en.wikipedia.org/wiki/Postal_codes_in_Japan
This commit is contained in:
Shohei Tanaka 2016-05-10 07:33:47 +09:00
parent 857471843a
commit 2d5d7d1494
1 changed files with 3 additions and 0 deletions

View File

@ -67,6 +67,9 @@ class WC_Validation {
case 'GB' :
$valid = self::is_GB_postcode( $postcode );
break;
case 'JP' :
$valid = (bool) preg_match( '/^\d{3}\-\d{4}$/', $postcode );
break;
case 'PT' :
$valid = (bool) preg_match( '/^([0-9]{4})([-])([0-9]{3})$/', $postcode );
break;