From 7f489f8692b21e3ead19132d3c637faace8374aa Mon Sep 17 00:00:00 2001 From: teko Date: Thu, 8 Jun 2023 11:15:11 +0300 Subject: [PATCH] Allow new format LV personal codes (32XXXX-XXXXX or 32XXXXXXXXX) and make hyphen optional --- src/Validator/Constraints/Code.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Validator/Constraints/Code.php b/src/Validator/Constraints/Code.php index b07dc7b..c4a106e 100644 --- a/src/Validator/Constraints/Code.php +++ b/src/Validator/Constraints/Code.php @@ -59,7 +59,7 @@ private function getCountryPatterns() 'test' => '11412090004|14212128029|111180-99987', 'lt,ee' => '[3456]{1}[0-9]{2}(0[1-9]|1[0-2])\d{6}', 'fi' => '[0-9]{2}(0[1-9]|1[0-2])[0-9]{2}[\+-A]\d{4}', - 'lv' => '[0-9]{2}(0[1-9]|1[0-2])[0-9]{2}\-[1-2]{1}[0-9]{4}', + 'lv' => '[0-9]{2}(?:0[1-9]|1[0-2])[0-9]{2}\-?[1-2]{1}[0-9]{4}|32\d{4}\-?\d{5}', 'is' => '(1[0-9]|0[1-9]|2[0-9]|3[0-1])(1[0-2]|0[1-9])[0-9]{2}\d{4}', ]; }