diff --git a/internal/nha/parse.go b/internal/nha/parse.go index 7595d4ad..7f96f46e 100644 --- a/internal/nha/parse.go +++ b/internal/nha/parse.go @@ -14,7 +14,7 @@ var regexTransfer = regexp.MustCompile( `(?P(?i:DPJ|EPJ|OTHER|AVL-DPJ|AVL-EPJ|AVL-OTHER))-(?i:SIP)` + `[-_]` + `(?:` + - `(?P[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[1-5][a-zA-Z0-9]{3}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})` + + `(?P[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})` + `|` + `(?P[0-9.]+)[-_](?P\d{6,8})` + `)` + diff --git a/internal/nha/parse_test.go b/internal/nha/parse_test.go index 7f9b3827..cbafd432 100644 --- a/internal/nha/parse_test.go +++ b/internal/nha/parse_test.go @@ -121,6 +121,17 @@ func TestParse(t *testing.T) { Value: "dpj-sip-814ecc88-b459-4304-8868-9ed72875f5fc", }, }, + { + desc: "Identifiers not based on RFC 4122", + input: "dpj-sip-4ba94e92-d200-81eb-b8bc-0242ac130003", + wantResult: NameInfo{ + Identifier: "4ba94e92-d200-81eb-b8bc-0242ac130003", + Type: TransferTypeDPJ, + Date: time.Time{}, + Extension: "", + Value: "dpj-sip-4ba94e92-d200-81eb-b8bc-0242ac130003", + }, + }, { desc: "Unexpected UUID format", input: "dpj-sip-814ecc88-b459-4304-8868-9ed72875f5fZ",