Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Validator] Sync IBAN formats with Swift IBAN registry#48998
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedJan 16, 2023
Thanks for the PR. How did you update the file? Would it make sense to commit some generator in the repo to make it easy to sync with upstream? |
smelesh commentedJan 16, 2023
@nicolas-grekas, nice idea to keep it up to date. I have a script that parses registry file and generates regexp list. It was merged manually to preserve existing php comments. But I have some doubts:
|
stof commentedJan 17, 2023
@smelesh We already have similar scripts in some components (parsing the ICU data for instance). So I suggest including such script in the repository. Comments can actually be part of the generated output. The Swift file contains the country name. Regarding experimental countries, I see that the Wikipedia page about IBAN references them with their BBAN format:https://en.wikipedia.org/wiki/International_Bank_Account_Number#cite_ref-48. This is enough to get the IBAN format (as IBAN is 2-letter country code followed by 2-digit checksum followed by BBAN) |
smelesh commentedFeb 19, 2023
Sorry for the delay.. Added a script to collect IBAN formats from Wikipedia (experimental) and SWIFT registry (official): I cannot find how similar scripts are triggered (for example, Since comments in -'AX' => 'FI\d{2}\d{6}\d{7}\d{1}',+'AX' => 'FI\d{2}\d{3}\d{11}',-'BF' => 'BF\d{2}\d{23}',+'BF' => 'BF\d{2}[\dA-Z]{2}\d{22}',-'BI' => 'BI\d{2}\d{12}',+'BI' => 'BI\d{2}\d{5}\d{5}\d{11}\d{2}',-'BJ' => 'BJ\d{2}[A-Z]{1}\d{23}',+'BJ' => 'BJ\d{2}[\dA-Z]{2}\d{22}',-'BR' => 'BR\d{2}\d{8}\d{5}\d{10}[A-Z][\dA-Z]',+'BR' => 'BR\d{2}\d{8}\d{5}\d{10}[A-Z]{1}[\dA-Z]{1}',+'CF' => 'CF\d{2}\d{23}',-'CR' => 'CR\d{2}0\d{3}\d{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}\d{22}',+'SO' => 'SO\d{2}\d{4}\d{3}\d{12}',+'ST' => 'ST\d{2}\d{4}\d{4}\d{11}\d{2}',+'SV' => 'SV\d{2}[A-Z]{4}\d{20}',+'TD' => 'TD\d{2}\d{23}',+'TG' => 'TG\d{2}[A-Z]{2}\d{22}',-'TR' => 'TR\d{2}\d{5}[\dA-Z]{1}[\dA-Z]{16}',+'TR' => 'TR\d{2}\d{5}\d{1}[\dA-Z]{16}', |
ac25782 to3937610Comparestof commentedFeb 22, 2023
They are run manually by a contributor once in a while. |
3937610 to9c5c863Comparesrc/Symfony/Component/Validator/Resources/bin/sync-iban-formats.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Validator/Resources/bin/sync-iban-formats.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
9c5c863 tob8a0e25Compareb8a0e25 tod4e3047Comparenicolas-grekas commentedFeb 22, 2023
Thank you@smelesh. |
Uh oh!
There was an error while loading.Please reload this page.
Gathered IBAN formats fromIBAN Registry provided by SWIFT.
Some countries don't exist in the registry (Angola, Burkina Faso, Benin, Congo, Ivory Coast, Cameron, Cape Verde, Algeria, Iran, Madagascar, Mali, Mozambique, Senegal). I can't verify the format, but they are marked experimental here:https://www.iban.com/structure
Some formats were changed (Burundi, Costa Rica, Kuwait, Turkey). Is it a BC break?