fix: NIP regex handles any separator format (588-20-15-465)
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

Previous regex only matched 3-3-2-2 format. New universal pattern
catches any 10-digit NIP with dashes/spaces in any position.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Maciej Pienczyn 2026-02-21 09:31:09 +01:00
parent 409557ceab
commit ec8d419fad

View File

@ -89,7 +89,7 @@ def _validate_regon(regon):
def _find_nips_in_text(text):
patterns = [
r'NIP[:\s]*(\d{3}[-\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2})',
r'NIP[:\s]*([\d][\d\s-]{8,13}[\d])', # any 10-digit with separators
r'NIP[:\s]*(\d{10})',
r'numer\s+identyfikacji\s+podatkowej[:\s]*(\d{10})',
]