Skip to content

fix: Improve regex to extract unstructured fields - #601

Merged
nemiah merged 1 commit into
nemiah:masterfrom
Gared:fix_camt_ustrd_parser
Oct 29, 2026
Merged

nemiah merged 1 commit into
nemiah:masterfrom
Gared:fix_camt_ustrd_parser

Conversation

@Gared

@Gared Gared commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

This will improve the extraction of unstructured fields out of Ustrd.
I added tests by using reflections to test the private method. I noticed that the IBAN regex seems weird to me because letters are explicitly allowed after the first characters. For me that doesn't sound right, but maybe there is a reason and I didn't touch it.

The new regex will read now all characters until a new tag/field begins. This started to be an issue after reading now all tags in #583.
We should fix this issue before releasing a new version @nemiah

@ampaze

ampaze commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Side note: IBAN can contain alphanumeric (uppercase) characters after the checksum, and in many countries they do.

@Gared

Gared commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Side note: IBAN can contain alphanumeric (uppercase) characters after the checksum, and in many countries they do.

Thank you for the info. I checked some examples and it's more complicated then I thought. Anyway: I left the IBAN regex untouched so we should be fine :)

@nemiah
nemiah merged commit 639a3d2 into nemiah:master Oct 29, 2026
7 checks passed
nemiah pushed a commit that referenced this pull request Nov 2, 2026
The baseline of #603 was generated before #594, #598 and #601 were merged,
so master reports 19 errors. They are fixed in the code instead of being
added to the baseline:

- Return types for the new test methods and HKWPDv6::setPaginationToken().
- Array value types for GetSEPAAccounts::__serialize()/__unserialize() and
  the CAMT data provider.
- GetSEPAAccountsTest builds the UPD from HIUPDv6 segments, as UPD::$hiupd
  expects.
- HIUPDTest converts its examples in a typed helper (self:: instead of
  static::), which also clears the six baselined parse() errors.
- Drop the two CAMT baseline entries that #601 made obsolete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants