german postcode validation

This commit is contained in:
wtom 2015-10-08 12:20:57 +02:00
parent 1889c66061
commit 7368377e8d
1 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,9 @@ class WC_Validation {
case 'CH' :
$valid = (bool) preg_match( '/^([0-9]{4})$/i', $postcode );
break;
case 'DE' :
$valid = (bool) preg_match( '/^([0]{1}[1-9]{1}|[1-9]{1}[0-9]{1})[0-9]{3}$/', $postcode );
break;
case 'GB' :
$valid = self::is_GB_postcode( $postcode );
break;