Eircode regex

This commit is contained in:
Mike Jolley 2018-05-03 11:26:13 +01:00
parent 1e227dcc2e
commit 78f34aed99
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ class WC_Validation {
case 'GB':
$valid = self::is_gb_postcode( $postcode );
break;
case 'IE':
$valid = (bool) preg_match( '/([AC-FHKNPRTV-Y]\d{2}|D6W)[0-9AC-FHKNPRTV-Y]{4}/', wc_normalize_postcode( $postcode ) );
break;
case 'JP':
$valid = (bool) preg_match( '/^([0-9]{3})([-])([0-9]{4})$/', $postcode );
break;