PostalCodeHelper::match() doesn't accept operator modifiers on regular expressions
ekes opened this issue · 0 comments
ekes commented
Example:
PostalCodeHelper::match('ze1 1aa', '', '/ZE[0-9]/i')
won't work because
addressing/src/PostalCodeHelper.php
Line 47 in 32fba7d
/
and ending with /
.
The only solution I can think of at the moment is to change to:
$match = preg_match($rule, $postalCode);
if ($match === FALSE) {
$match = in_array($postalCode, self::buildList($rule));
}
Don't know if that would be acceptable?