Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statement and sequence numbers aren't correctly parsed when without filling 0 digits #52

Open
hapm opened this issue Mar 12, 2021 · 2 comments · May be fixed by #53
Open

Statement and sequence numbers aren't correctly parsed when without filling 0 digits #52

hapm opened this issue Mar 12, 2021 · 2 comments · May be fixed by #53

Comments

@hapm
Copy link

hapm commented Mar 12, 2021

The current regex to parse the statement and sequence numbers doesn't follow the swift specs as declared here.

The examples :28C:235/1 and :28C:235/1 provided in the spec will not match because the regex expects 5 digits for the statement and 3 to 5 digits for the sequence number. The sequence number should be optional and the regex should allow shorter statement and sequence numbers. I would suggest:

/(?<statement_number>\d{1,5})(?:\/(?<sequence_number>\d{1,5}))?/
@bumi
Copy link
Contributor

bumi commented Mar 12, 2021

thanks for raising this. Could you put your suggestion in a PR with an additional test with these examples?
that would be amazing. If it does not break any of the other tests then we can merge and release this.

@hapm
Copy link
Author

hapm commented Mar 15, 2021

I'll see if I come to that tomorrow.

@hapm hapm linked a pull request Apr 1, 2021 that will close this issue
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 a pull request may close this issue.

2 participants