From 78f34aed99fefe775af8a3265ec9e36f728f4bd8 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Thu, 3 May 2018 11:26:13 +0100 Subject: [PATCH] Eircode regex --- includes/class-wc-validation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-wc-validation.php b/includes/class-wc-validation.php index 2dce534dc5d..0b7094eaf2b 100644 --- a/includes/class-wc-validation.php +++ b/includes/class-wc-validation.php @@ -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;