Make NL postcode validation more flexible

Allows postcode without spaces and in lowercase.
This commit is contained in:
Claudio Sanches 2019-05-28 20:51:07 -03:00
parent 2e90e9ab65
commit e04e9ae521
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class WC_Validation {
$valid = (bool) preg_match( '/^([0-9]{3})(\s?)([0-9]{2})$/', $postcode );
break;
case 'NL':
$valid = (bool) preg_match( '/^[1-9][0-9]{3}\s(?!SA|SD|SS)[A-Z]{2}$/', $postcode );
$valid = (bool) preg_match( '/^([1-9][0-9]{3})(\s?)(?!SA|SD|SS|sa|sd|ss)[A-Za-z]{2}$/', $postcode );
break;
default: