From a55fbe7d6a5be62aafe3217ea237ab999b1a9f31 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:24:39 +0200 Subject: [PATCH 1/7] refactor: move comparer to T4 --- SupportedCountries.tt | 35 ++++++++++++++++ .../IbanCountryCodeComparer.cs | 41 ------------------- 2 files changed, 35 insertions(+), 41 deletions(-) delete mode 100644 src/IbanNet.CodeGen/IbanCountryCodeComparer.cs diff --git a/SupportedCountries.tt b/SupportedCountries.tt index 21032839..8558f322 100644 --- a/SupportedCountries.tt +++ b/SupportedCountries.tt @@ -133,4 +133,39 @@ private void RenderIncludedCountries(IIbanRegistryProvider provider) } } } + +private sealed class IbanCountryCodeComparer : IEqualityComparer +{ + /// + public bool Equals(IbanCountry? x, IbanCountry? y) + { + if (ReferenceEquals(x, y)) + { + return true; + } + + if (ReferenceEquals(x, null)) + { + return false; + } + + if (ReferenceEquals(y, null)) + { + return false; + } + + if (x.GetType() != y.GetType()) + { + return false; + } + + return x.TwoLetterISORegionName == y.TwoLetterISORegionName; + } + + /// + public int GetHashCode(IbanCountry obj) + { + return obj?.TwoLetterISORegionName.GetHashCode() ?? 0; + } +} #> diff --git a/src/IbanNet.CodeGen/IbanCountryCodeComparer.cs b/src/IbanNet.CodeGen/IbanCountryCodeComparer.cs deleted file mode 100644 index 3075426e..00000000 --- a/src/IbanNet.CodeGen/IbanCountryCodeComparer.cs +++ /dev/null @@ -1,41 +0,0 @@ -using IbanNet.Registry; - -namespace IbanNet.CodeGen; - -/// -/// Compares by country code only. -/// -public sealed class IbanCountryCodeComparer : IEqualityComparer -{ - /// - public bool Equals(IbanCountry? x, IbanCountry? y) - { - if (ReferenceEquals(x, y)) - { - return true; - } - - if (ReferenceEquals(x, null)) - { - return false; - } - - if (ReferenceEquals(y, null)) - { - return false; - } - - if (x.GetType() != y.GetType()) - { - return false; - } - - return x.TwoLetterISORegionName == y.TwoLetterISORegionName; - } - - /// - public int GetHashCode(IbanCountry obj) - { - return obj?.TwoLetterISORegionName.GetHashCode() ?? 0; - } -} From 3ff836aedceeb6d532f591de499baaa01313e8bf Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:41:53 +0200 Subject: [PATCH 2/7] feat: generate SwiftRegistryProvider using source generator instead of T4 --- src/Directory.Build.targets | 2 +- .../SourceProductionContextExtensions.cs | 31 + src/IbanNet.CodeGen/IRegistryDataSource.cs | 9 + src/IbanNet.CodeGen/IbanNet.CodeGen.csproj | 64 +- .../Liquid/FluidProviderGenerator.cs | 132 + .../Liquid/PatternClass.liquid | 68 + .../Liquid/RegistryProvider.liquid | 116 + .../Properties/launchSettings.json | 8 + .../RegistryProviderTransformGenerator.cs | 129 + .../SanitizedCountryCodeListConverter.cs | 17 + src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs | 17 +- src/IbanNet.CodeGen/Swift/SwiftDataSource.cs | 33 + src/IbanNet.CodeGen/Syntax/InputSource.cs | 17 + src/IbanNet.CodeGen/Syntax/LocationInfo.cs | 17 + .../Syntax/RegistryProviderTarget.cs | 41 + .../RegistrySourceAttribute.g.cs | 15 + .../SwiftRegistryProvider.g.cs | 9376 +++++++++++++++++ src/IbanNet/IbanNet.csproj | 22 +- src/IbanNet/Registry/Patterns/Pattern.cs | 13 + src/IbanNet/Registry/Patterns/PatternToken.cs | 2 + .../Registry/Patterns/PatternTokenizer.cs | 4 + .../Registry/Swift/SwiftRegistryProvider.cs | 6538 +----------- .../Registry/Swift/SwiftRegistryProvider.tt | 230 - .../IbanNet.CodeGen.Tests.csproj | 2 + .../{ => Swift}/SwiftCsvReaderTests.cs | 23 +- .../SwiftRegistryProvider.verified.txt | 6 - 26 files changed, 10116 insertions(+), 6816 deletions(-) create mode 100644 src/IbanNet.CodeGen/Extensions/SourceProductionContextExtensions.cs create mode 100644 src/IbanNet.CodeGen/IRegistryDataSource.cs create mode 100644 src/IbanNet.CodeGen/Liquid/FluidProviderGenerator.cs create mode 100644 src/IbanNet.CodeGen/Liquid/PatternClass.liquid create mode 100644 src/IbanNet.CodeGen/Liquid/RegistryProvider.liquid create mode 100644 src/IbanNet.CodeGen/Properties/launchSettings.json create mode 100644 src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs create mode 100644 src/IbanNet.CodeGen/Swift/Converters/SanitizedCountryCodeListConverter.cs create mode 100644 src/IbanNet.CodeGen/Swift/SwiftDataSource.cs create mode 100644 src/IbanNet.CodeGen/Syntax/InputSource.cs create mode 100644 src/IbanNet.CodeGen/Syntax/LocationInfo.cs create mode 100644 src/IbanNet.CodeGen/Syntax/RegistryProviderTarget.cs create mode 100644 src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs create mode 100644 src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/SwiftRegistryProvider.g.cs delete mode 100644 src/IbanNet/Registry/Swift/SwiftRegistryProvider.tt rename test/IbanNet.CodeGen.Tests/{ => Swift}/SwiftCsvReaderTests.cs (72%) diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets index 2d6114ab..f792aeba 100644 --- a/src/Directory.Build.targets +++ b/src/Directory.Build.targets @@ -8,7 +8,7 @@ true true - true + true snupkg diff --git a/src/IbanNet.CodeGen/Extensions/SourceProductionContextExtensions.cs b/src/IbanNet.CodeGen/Extensions/SourceProductionContextExtensions.cs new file mode 100644 index 00000000..bd08e2fe --- /dev/null +++ b/src/IbanNet.CodeGen/Extensions/SourceProductionContextExtensions.cs @@ -0,0 +1,31 @@ +using Microsoft.CodeAnalysis; + +namespace IbanNet.CodeGen.Extensions; + +internal static class SourceProductionContextExtensions +{ + internal static void ReportWarning + ( + this SourceProductionContext ctx, + string errorCode, + string title, + string message, + string category, + Location? location = null + ) + { + ctx.ReportDiagnostic( + Diagnostic.Create( + new DiagnosticDescriptor( + errorCode, + title, + message, + category, + DiagnosticSeverity.Warning, + true + ), + location ?? Location.None + ) + ); + } +} diff --git a/src/IbanNet.CodeGen/IRegistryDataSource.cs b/src/IbanNet.CodeGen/IRegistryDataSource.cs new file mode 100644 index 00000000..143334e8 --- /dev/null +++ b/src/IbanNet.CodeGen/IRegistryDataSource.cs @@ -0,0 +1,9 @@ +using IbanNet.CodeGen.Swift; + +namespace IbanNet.CodeGen; + +internal interface IRegistryDataSource +{ + bool IsDataSource(string path); + SwiftCsvRecord[] GetCountryDefinitions(string text); +} diff --git a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj index 84916390..554834ef 100644 --- a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj +++ b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj @@ -3,35 +3,71 @@ netstandard2.0 false - true + enable + enable + $(NoWarn);CS1591 + true + true + false + true + IbanNet.CodeGen false $(WarningsNotAsErrors);CS1591 - - True - True - SupportedCountries.tt - - - TextTemplatingFileGenerator - SupportedCountries.md - + + + + + + + + + + + + + + + + + - - - + + + true + $(GetTargetPathDependsOn);GetDependencyTargetPaths + + + + + + + - + + True + True + SupportedCountries.tt + + + TextTemplatingFileGenerator + SupportedCountries.md + diff --git a/src/IbanNet.CodeGen/Liquid/FluidProviderGenerator.cs b/src/IbanNet.CodeGen/Liquid/FluidProviderGenerator.cs new file mode 100644 index 00000000..c34bf702 --- /dev/null +++ b/src/IbanNet.CodeGen/Liquid/FluidProviderGenerator.cs @@ -0,0 +1,132 @@ +using System.Text; +using Fluid; +using Fluid.Ast; +using Fluid.Parser; +using Fluid.Values; +using IbanNet.CodeGen.Extensions; +using IbanNet.CodeGen.Swift; +using IbanNet.CodeGen.Syntax; +using IbanNet.Registry.Patterns; +using Microsoft.CodeAnalysis; +using Microsoft.Extensions.FileProviders; + +namespace IbanNet.CodeGen.Liquid; + +internal sealed class FluidProviderGenerator +{ + public string Compile(SourceProductionContext ctx, RegistryProviderTarget target, IEnumerable model) + { + IFluidTemplate template = LoadTemplate(ctx, target, "RegistryProvider"); + + var opts = new TemplateOptions + { + // We're not distributing the code generator, it is only used by ourselves, so it is safe to allow all properties. + MemberAccessStrategy = new UnsafeMemberAccessStrategy { IgnoreCasing = true }, FileProvider = new EmbeddedFileProvider(GetType().Assembly, GetType().Namespace!) + }; + opts.ValueConverters.Add(value => value is AsciiCategory v ? Enum.GetName(typeof(AsciiCategory), v) : null); + opts.ValueConverters.Add(value => value is IbanCsvData v ? new StructureValue(v, s => new PatternWrapper(s, v.Tokenizer)) : null); + opts.ValueConverters.Add(value => value is PatternCsvData v ? new StructureValue(v, s => new PatternWrapper(s, v.Tokenizer)) : null); + var m = new + { + Generator = new { Name = nameof(RegistryProviderTransformGenerator), Version = "2.0" }, + Syntax = target, + Datasource = target.InputSourcePath, + Countries = model + .Where(record => !Boycott(record.CountryCode)) + .OrderBy(record => record.CountryCode) + .ToList() + }; + + var context = new TemplateContext(m, opts); + try + { + return template.Render(context); + } + catch (ParseException ex) + { + ctx.ReportWarning("IBAN9103", "Liquid template rendering failed.", ex.Message, GetType().FullName!, target.Location); + return string.Empty; + } + } + + private IFluidTemplate LoadTemplate(SourceProductionContext ctx, RegistryProviderTarget target, string name) + { + string resourceName = $"{name}.liquid"; + string errorCode, errorTitle, errorMsg; + + using Stream? stream = typeof(FluidProviderGenerator).Assembly.GetManifestResourceStream(typeof(FluidProviderGenerator), resourceName); + if (stream is null) + { + errorCode = "IBAN9101"; + errorTitle = "Cannot load liquid template from embedded resource."; + errorMsg = $"The liquid template in resource stream '{resourceName}' could not be loaded."; + } + else + { + using var sr = new StreamReader(stream, Encoding.UTF8); + string source = sr.ReadToEnd(); + + var opts = new FluidParserOptions { AllowFunctions = true }; + var parser = new FluidParser(opts); + + RegisterRepeatBlock(parser); + + if (parser.TryParse(source, out IFluidTemplate? template, out errorMsg)) + { + return template; + } + + errorCode = "IBAN9102"; + errorTitle = "Failed to parse liquid template."; + } + + ctx.ReportWarning(errorCode, errorTitle, errorMsg, GetType().FullName!, target.Location); + + return new FluidTemplate(); + } + + private static void RegisterRepeatBlock(FluidParser parser) + { + parser.RegisterExpressionBlock("repeat", + async (value, statements, writer, encoder, context) => + { + FluidValue? repeatCount = await value.EvaluateAsync(context).ConfigureAwait(false); + for (int i = 0; i < repeatCount.ToNumberValue(); i++) + { + await statements.RenderStatementsAsync(writer, encoder, context).ConfigureAwait(false); + } + + return Completion.Normal; + }); + } + + private sealed class StructureValue + : ObjectValueBase + { + private readonly Func _patternConverter; + + public StructureValue(object value, Func patternConverter) + : base(value) + { + _patternConverter = patternConverter; + } + + public override ValueTask GetValueAsync(string name, TemplateContext context) + { + if (name != "pattern") + { + return base.GetValueAsync(name, context); + } + + string? pattern = (Value as PatternCsvData)?.Pattern ?? (Value as IbanCsvData)?.Pattern; + return pattern is null + ? base.GetValueAsync(name, context) + : Create(_patternConverter(pattern), context.Options); + } + } + + private static bool Boycott(string countryCode) + { + return countryCode == "RU"; // Go Ukraine! + } +} diff --git a/src/IbanNet.CodeGen/Liquid/PatternClass.liquid b/src/IbanNet.CodeGen/Liquid/PatternClass.liquid new file mode 100644 index 00000000..1b44f3a4 --- /dev/null +++ b/src/IbanNet.CodeGen/Liquid/PatternClass.liquid @@ -0,0 +1,68 @@ +{%- if pattern %} +{%- if unrolled %} + internal static readonly Pattern {{ name }} = new {{ name }}Impl(); + + private sealed class {{ name }}Impl() + : +{%- else %} + internal static readonly Pattern {{ name }} = new +{%- endif %} Pattern("{{ pattern }}", {{ pattern.maxLength }}, {{ pattern.isFixedLength }}, + [ + {%- for token in pattern.tokens -%} + {%- case token.category %} + {%- when "None", "Other" %} + new PatternToken("{{ token.value }}"), + {%- else %} + new PatternToken(AsciiCategory.{{ token.category }}, {{ token.maxLength }}), + {%- endcase %} + {%- endfor %} + ] + ) +{%- if unrolled %} + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + {%- for token in pattern.tokens -%} + {%- assign i = 0 %} + {%- repeat token.maxLength %} + {%- case token.category %} + {%- when "None", "Other" %} + && value[pos++] == '{{ token.value | slice: i, 1 }}' + {%- assign i = i | plus: 1 %} + {%- when "Space" %} + && value[pos++] == ' ' + {%- when "Digit" %} + && value[pos++].IsAsciiDigit() + {%- when "AlphaNumeric" %} + && value[pos++].IsAlphaNumeric() + {%- when "UppercaseLetter" %} + && value[pos++].IsUpperAsciiLetter() + {%- when "LowercaseLetter" %} + && value[pos++].IsLowerAsciiLetter() + {%- when "Letter" %} + && value[pos++].IsAsciiLetter() + {%- else %} + // Unknown + {%- endcase %} + {%- endrepeat %} + {%- endfor %} + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } +{%- else -%} + ; +{%- endif -%} +{%- endif -%} diff --git a/src/IbanNet.CodeGen/Liquid/RegistryProvider.liquid b/src/IbanNet.CodeGen/Liquid/RegistryProvider.liquid new file mode 100644 index 00000000..c2dd5674 --- /dev/null +++ b/src/IbanNet.CodeGen/Liquid/RegistryProvider.liquid @@ -0,0 +1,116 @@ +{% macro generated_code(generator, version) -%} +[GeneratedCode("{{ generator }}", "{{ version }}")] +{%- endmacro -%} +{% macro patternDescriptor(countryCode, name, descriptor, bbanOffset) -%} +{%- if descriptor.pattern %} + {{ name }} = new PatternDescriptor(Patterns.{{ countryCode }}.{{ name }} + {%- if bbanOffset -%} + , {{ bbanOffset | plus: 4 }} + {%- endif %}) + {%- if descriptor.example.size > 0 %} + { + Example = "{{ descriptor.example }}" + } + {%- endif %}, +{%- endif %} +{%- endmacro -%} + +// + +#nullable enable + +using System.CodeDom.Compiler; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using IbanNet.Extensions; +using IbanNet.Registry.Patterns; + +namespace {{ syntax.namespace }}; + +/// +/// Nr. of countries: {{ countries.size }} +/// +partial class {{ syntax.className }} +{ + /// + /// Generated from: {{ datasource }}
+ ///
+ {{ generated_code(generator.name, generator.version) }} + private static partial IEnumerable {{ syntax.methodName }}() + { + // ReSharper disable CommentTypo + // ReSharper disable StringLiteralTypo + + {%- if countries.size == 0 %} + yield break; // Empty registry provider!! + {% else %} + {%- for row in countries -%} + {%- assign bbanOffset = 4 %} + + // {{ row.englishName }} + yield return new IbanCountry("{{ row.countryCode }}") + { + NativeName = "{{ row.nativeName }}", + EnglishName = "{{ row.englishName }}", + {%- if row.otherTerritories.size > 0 %} + IncludedCountries = ["{{ row.otherTerritories | join: "\", \"" }}"], + {%- endif %} + {{- patternDescriptor(row.countryCode, "Iban", row.iban) }} + {{- patternDescriptor(row.countryCode, "Bban", row.bban, 0) }} + {{- patternDescriptor(row.countryCode, "Bank", row.bank, row.bank.position.startPos) }} + {{- patternDescriptor(row.countryCode, "Branch", row.branch, row.branch.position.startPos) }} + {%- if row.sepa %} + Sepa = new SepaInfo + { + IsMember = {{ row.sepa.isMember }} + {%- if row.sepa.otherTerritories.size > 0 -%} + , + IncludedCountries = ["{{ row.sepa.otherTerritories | join: "\", \"" }}"] + {%- endif %} + }, + {%- endif %} + {%- if row.domesticExample %} + DomesticAccountNumberExample = "{{ row.domesticExample }}", + {%- endif %} + {%- if row.lastUpdatedDate %} + LastUpdatedDate = new DateTimeOffset({{ row.lastUpdatedDate | date: "%Y" }}, {{ row.lastUpdatedDate | date: "%-m" }}, 1, 0, 0, 0, TimeSpan.Zero), + {%- endif %} + {%- if row.effectiveDate %} + EffectiveDate = new DateTimeOffset({{ row.effectiveDate | date: "%Y" }}, {{ row.effectiveDate | date: "%-m" }}, 1, 0, 0, 0, TimeSpan.Zero) + {%- endif %} + }; + + {%- endfor %} + {%- endif %} + + // ReSharper restore StringLiteralTypo + // ReSharper restore CommentTypo + } + + {{ generated_code(generator.name, generator.version) }} + private static class Patterns + { + {{ generated_code(generator.name, generator.version) }} + internal class Pattern : IbanNet.Registry.Patterns.Pattern + { + public Pattern(string pattern, int maxLength, bool isFixedLength, PatternToken[] tokens) + : base(pattern, maxLength, isFixedLength, tokens) + { + } + } + + {%- for row in countries %} + + // {{ row.englishName }} + {{ generated_code(generator.name, generator.version) }} + internal static class {{ row.countryCode }} + { +{% render "PatternClass", name: "Iban", pattern: row.iban.pattern, unrolled: true %} +{% render "PatternClass", name: "Bban", pattern: row.bban.pattern %} +{% render "PatternClass", name: "Bank", pattern: row.bank.pattern %} +{% render "PatternClass", name: "Branch", pattern: row.branch.pattern %} + } + + {%- endfor %} + } +} diff --git a/src/IbanNet.CodeGen/Properties/launchSettings.json b/src/IbanNet.CodeGen/Properties/launchSettings.json new file mode 100644 index 00000000..be6e13a9 --- /dev/null +++ b/src/IbanNet.CodeGen/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Debug Swift CodeGen": { + "commandName": "DebugRoslynComponent", + "targetProject": "..\\IbanNet\\IbanNet.csproj" + } + } +} diff --git a/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs b/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs new file mode 100644 index 00000000..0f6e7454 --- /dev/null +++ b/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs @@ -0,0 +1,129 @@ +using System.Diagnostics.CodeAnalysis; +using System.Text; +using IbanNet.CodeGen.Extensions; +using IbanNet.CodeGen.Liquid; +using IbanNet.CodeGen.Swift; +using IbanNet.CodeGen.Syntax; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Text; + +namespace IbanNet.CodeGen; + +[Generator] +public sealed class RegistryProviderTransformGenerator : IIncrementalGenerator +{ + internal static readonly Dictionary DataSources = new() + { + { "Swift", new SwiftDataSource() } + }; + private static readonly List GeneratorNames = DataSources.Keys.ToList(); + + private readonly FluidProviderGenerator _codeGenerator = new(); + + public void Initialize(IncrementalGeneratorInitializationContext context) + { + context.RegisterPostInitializationOutput(static ctx => ctx + .AddSource($"{MarkerAttribute.Name}.g.cs", SourceText.From(MarkerAttribute.Text, Encoding.UTF8)) + ); + + IncrementalValuesProvider providerTarget = context.SyntaxProvider + .ForAttributeWithMetadataName($"{MarkerAttribute.Namespace}.{MarkerAttribute.Name}", + IsSyntaxTargetForGeneration, + GetProviderTarget + ); + + // From additional files, load those that match the expected path/file name format. + IncrementalValuesProvider dataFiles = context.AdditionalTextsProvider + .Where(text => DataSources.Values.Any(g => g.IsDataSource(text.Path))) + .Select(static (text, ct) => new InputSource(text.Path, text.GetText(ct)?.ToString() ?? string.Empty)) + .Where(static d => !string.IsNullOrWhiteSpace(d.Text)); + + context.RegisterSourceOutput( + // Merge the provider targets with the data files that match the path from the marker attribute. + providerTarget + .Combine(dataFiles.Collect()) + .Select(static (src, _) => + { + InputSource file = src.Right.FirstOrDefault(x => x.FullName == src.Left.FullInputSourcePath); + return (Target: src.Left, DataFile: file); + }), + (ctx, t) => + { + SwiftCsvRecord[] rows; + if (string.IsNullOrWhiteSpace(t.DataFile.Text)) + { + // No matching additional file found. + ctx.ReportWarning( + "IBAN9000", + "Missing data source", + $"The data source '{t.Target.FullInputSourcePath}' was not found or is empty.", + nameof(RegistryProviderTransformGenerator), + t.Target.Location + ); + rows = []; + } + else + { + IRegistryDataSource dataSource = DataSources[t.Target.DataSourceType]; + rows = dataSource.GetCountryDefinitions(t.DataFile.Text); + } + + ctx.AddSource($"{t.Target.ClassName}.g.cs", _codeGenerator.Compile(ctx, t.Target, rows)); + }); + } + + private static bool IsSyntaxTargetForGeneration(SyntaxNode node, CancellationToken ct = default) + { + return node is MethodDeclarationSyntax { AttributeLists.Count: > 0 }; + } + + private static RegistryProviderTarget GetProviderTarget(GeneratorAttributeSyntaxContext ctx, CancellationToken ct = default) + { + int sourceType = ctx.Attributes[0].ConstructorArguments[0].Value as int? ?? -1; + string? sourceFilePath = ctx.Attributes[0].ConstructorArguments[1].Value as string; + if (sourceType < 0 || sourceType >= DataSources.Count + || sourceFilePath is null + || string.IsNullOrWhiteSpace(sourceFilePath) + || Path.IsPathRooted(sourceFilePath) + || !RegistryProviderTarget.TryCreate(ctx.TargetSymbol, GeneratorNames[sourceType], sourceFilePath, out RegistryProviderTarget target)) + { + ThrowInvalidPath(sourceFilePath); + } + + return target; + + [DoesNotReturn] + static void ThrowInvalidPath(string? path = null) + { + throw new InvalidOperationException( + $"The attribute '{MarkerAttribute.Name}' must specify a valid data source type and relative file path to the data source." + ); + } + } +} + +static file class MarkerAttribute +{ + internal static readonly string Namespace = typeof(MarkerAttribute).Namespace!; + + private const string EnumName = "RegistrySource"; + internal const string Name = $"{EnumName}Attribute"; + internal static readonly string Text = $$""" + // + + #nullable enable + + namespace {{Namespace}}; + + internal enum {{EnumName}} + { + ## ENUM_VALUES ## + } + + [global::System.AttributeUsage(global::System.AttributeTargets.Method, Inherited = true, AllowMultiple = false)] + #pragma warning disable CS9113 // Parameter is unread. + internal sealed class {{Name}}({{EnumName}} Source, string Path) : global::System.Attribute; + #pragma warning restore CS9113 // Parameter is unread. + """.Replace("## ENUM_VALUES ##", string.Join(", ", RegistryProviderTransformGenerator.DataSources.Keys)); +} diff --git a/src/IbanNet.CodeGen/Swift/Converters/SanitizedCountryCodeListConverter.cs b/src/IbanNet.CodeGen/Swift/Converters/SanitizedCountryCodeListConverter.cs new file mode 100644 index 00000000..9e6b45be --- /dev/null +++ b/src/IbanNet.CodeGen/Swift/Converters/SanitizedCountryCodeListConverter.cs @@ -0,0 +1,17 @@ +using CsvHelper; +using CsvHelper.Configuration; + +namespace IbanNet.CodeGen.Swift.Converters; + +internal class SanitizedCountryCodeListConverter : CommaSeparatedEnumerableConverter +{ + public override object ConvertFromString(string? text, IReaderRow row, MemberMapData memberMapData) + { + var countryCodes = (List)base.ConvertFromString(text, row, memberMapData); + for (int i = 0; i < countryCodes.Count; i++) + { + countryCodes[i] = countryCodes[i].Substring(0, 2).ToUpperInvariant(); + } + return countryCodes; + } +} diff --git a/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs b/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs index 10378adb..00623105 100644 --- a/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs +++ b/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs @@ -52,7 +52,7 @@ public string? NativeName public SepaCsvData Sepa { get; set; } = default!; [Name("Country code includes other countries/territories")] - [TypeConverter(typeof(CommaSeparatedEnumerableConverter))] + [TypeConverter(typeof(SanitizedCountryCodeListConverter))] [NullValues("N/A")] #pragma warning disable CA2227 // Collection properties should be read only public ICollection OtherTerritories { get; set; } = default!; @@ -61,12 +61,12 @@ public string? NativeName [Name("Effective date")] [Format("MMM-yy")] [DateTimeStyles(DateTimeStyles.AssumeUniversal)] - public DateTimeOffset EffectiveDate { get; set; } + public DateTimeOffset? EffectiveDate { get; set; } [Name("Last update date")] [Format("MMM-yy")] [DateTimeStyles(DateTimeStyles.AssumeUniversal)] - public DateTimeOffset LastUpdatedDate { get; set; } + public DateTimeOffset? LastUpdatedDate { get; set; } } public record struct Position @@ -90,6 +90,12 @@ public record IbanCsvData [Name("IBAN print format example")] public string? PrintFormatExample { get; set; } + + [Ignore] + public string? Example => ElectronicFormatExample; + + [Ignore] + public ITokenizer Tokenizer { get; set; } = null!; } public abstract record PatternCsvData @@ -100,6 +106,9 @@ public abstract record PatternCsvData [TypeConverter(typeof(SanitizeExampleConverter))] public virtual string? Example { get; set; } + + [Ignore] + public ITokenizer Tokenizer { get; set; } = null!; } public record BbanCsvData : PatternCsvData @@ -153,7 +162,7 @@ public record SepaCsvData public bool IsMember { get; set; } [Name("SEPA country also includes")] - [TypeConverter(typeof(CommaSeparatedEnumerableConverter))] + [TypeConverter(typeof(SanitizedCountryCodeListConverter))] [NullValues("N/A")] #pragma warning disable CA2227 // Collection properties should be read only public ICollection OtherTerritories { get; set; } = default!; diff --git a/src/IbanNet.CodeGen/Swift/SwiftDataSource.cs b/src/IbanNet.CodeGen/Swift/SwiftDataSource.cs new file mode 100644 index 00000000..1c269ad5 --- /dev/null +++ b/src/IbanNet.CodeGen/Swift/SwiftDataSource.cs @@ -0,0 +1,33 @@ +using IbanNet.CodeGen.Swift.Patches; + +namespace IbanNet.CodeGen.Swift; + +internal sealed class SwiftDataSource : IRegistryDataSource +{ + public bool IsDataSource(string path) + { + string? fn = Path.GetFileName(path); + string? ext = Path.GetExtension(fn); + return fn is not null + && fn.StartsWith("swift_iban_registry", StringComparison.InvariantCulture) + && fn.IndexOf(".r", StringComparison.Ordinal) != -1 + && ext == ".txt"; + } + + public SwiftCsvRecord[] GetCountryDefinitions(string text) + { + var tokenizer = new SwiftPatternTokenizer(); + using var csv = new SwiftCsvReader(new StringReader(text)); + return csv.GetRecords() + .Select(RecordPatcher.ApplyAll) + .Select(record => + { + record.Iban.Tokenizer = tokenizer; + record.Bban.Tokenizer = tokenizer; + record.Bank.Tokenizer = tokenizer; + record.Branch.Tokenizer = tokenizer; + return record; + }) + .ToArray(); + } +} diff --git a/src/IbanNet.CodeGen/Syntax/InputSource.cs b/src/IbanNet.CodeGen/Syntax/InputSource.cs new file mode 100644 index 00000000..9e3d5865 --- /dev/null +++ b/src/IbanNet.CodeGen/Syntax/InputSource.cs @@ -0,0 +1,17 @@ +namespace IbanNet.CodeGen.Syntax; + +internal readonly record struct InputSource +( + string FullName, + string Text +) +{ + public string Name { get => Path.GetFileName(FullName); } + + public string RegistryVersion + { + get => string.IsNullOrEmpty(Name) + ? null! + : Name.Split('.')[1]; + } +} diff --git a/src/IbanNet.CodeGen/Syntax/LocationInfo.cs b/src/IbanNet.CodeGen/Syntax/LocationInfo.cs new file mode 100644 index 00000000..710b687d --- /dev/null +++ b/src/IbanNet.CodeGen/Syntax/LocationInfo.cs @@ -0,0 +1,17 @@ +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Text; + +namespace IbanNet.CodeGen.Syntax; + +internal readonly record struct LocationInfo +( + string Path, + TextSpan Text, + LinePositionSpan LinePosition +) +{ + public static implicit operator Location(LocationInfo li) + { + return Location.Create(li.Path, li.Text, li.LinePosition); + } +} diff --git a/src/IbanNet.CodeGen/Syntax/RegistryProviderTarget.cs b/src/IbanNet.CodeGen/Syntax/RegistryProviderTarget.cs new file mode 100644 index 00000000..1abcc33e --- /dev/null +++ b/src/IbanNet.CodeGen/Syntax/RegistryProviderTarget.cs @@ -0,0 +1,41 @@ +using Microsoft.CodeAnalysis; + +namespace IbanNet.CodeGen.Syntax; + +internal readonly record struct RegistryProviderTarget +( + string Namespace, + string ClassName, + string MethodName, + string DataSourceType, + string InputSourcePath, + string FullInputSourcePath, + LocationInfo Location +) +{ + public static bool TryCreate + ( + ISymbol symbol, + string dataSourceType, + string inputSourcePath, + out RegistryProviderTarget target) + { + if (symbol is not IMethodSymbol ms) + { + target = default; + return false; + } + + Location l = symbol.Locations.First(); + FileLinePositionSpan ls = l.GetLineSpan(); + target = new RegistryProviderTarget( + ms.ContainingType.ContainingNamespace.ToString(), + ms.ContainingType.Name, + ms.Name, + dataSourceType, + inputSourcePath, + Path.Combine(Path.GetDirectoryName(ls.Path)!, inputSourcePath), + new LocationInfo(ls.Path, l.SourceSpan, ls.Span)); + return true; + } +} diff --git a/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs new file mode 100644 index 00000000..ff96991e --- /dev/null +++ b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs @@ -0,0 +1,15 @@ +// + +#nullable enable + +namespace IbanNet.CodeGen; + +internal enum RegistrySource +{ + Swift +} + +[global::System.AttributeUsage(global::System.AttributeTargets.Method, Inherited = true, AllowMultiple = false)] +#pragma warning disable CS9113 // Parameter is unread. +internal sealed class RegistrySourceAttribute(RegistrySource Source, string Path) : global::System.Attribute; +#pragma warning restore CS9113 // Parameter is unread. \ No newline at end of file diff --git a/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/SwiftRegistryProvider.g.cs b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/SwiftRegistryProvider.g.cs new file mode 100644 index 00000000..fd663c2c --- /dev/null +++ b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/SwiftRegistryProvider.g.cs @@ -0,0 +1,9376 @@ +// + +#nullable enable + +using System.CodeDom.Compiler; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using IbanNet.Extensions; +using IbanNet.Registry.Patterns; + +namespace IbanNet.Registry.Swift; + +/// +/// Nr. of countries: 88 +/// +partial class SwiftRegistryProvider +{ + /// + /// Generated from: Files\swift_iban_registry_202412.r99.txt
+ ///
+ [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + private static partial IEnumerable Load() + { + // ReSharper disable CommentTypo + // ReSharper disable StringLiteralTypo + + // Andorra + yield return new IbanCountry("AD") + { + NativeName = "Andorra", + EnglishName = "Andorra", + Iban = new PatternDescriptor(Patterns.AD.Iban) + { + Example = "AD1200012030200359100100" + }, + Bban = new PatternDescriptor(Patterns.AD.Bban, 4) + { + Example = "00012030200359100100" + }, + Bank = new PatternDescriptor(Patterns.AD.Bank, 4) + { + Example = "0001" + }, + Branch = new PatternDescriptor(Patterns.AD.Branch, 8) + { + Example = "2030" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "2030200359100100", + LastUpdatedDate = new DateTimeOffset(2021, 3, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // United Arab Emirates (The) + yield return new IbanCountry("AE") + { + NativeName = "الإمارات العربية المتحدة", + EnglishName = "United Arab Emirates (The)", + Iban = new PatternDescriptor(Patterns.AE.Iban) + { + Example = "AE070331234567890123456" + }, + Bban = new PatternDescriptor(Patterns.AE.Bban, 4) + { + Example = "0331234567890123456" + }, + Bank = new PatternDescriptor(Patterns.AE.Bank, 4) + { + Example = "033" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "1234567890123456", + LastUpdatedDate = new DateTimeOffset(2015, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2011, 10, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Albania + yield return new IbanCountry("AL") + { + NativeName = "Shqipëri", + EnglishName = "Albania", + Iban = new PatternDescriptor(Patterns.AL.Iban) + { + Example = "AL47212110090000000235698741" + }, + Bban = new PatternDescriptor(Patterns.AL.Bban, 4) + { + Example = "212110090000000235698741" + }, + Bank = new PatternDescriptor(Patterns.AL.Bank, 4) + { + Example = "21211009" + }, + Branch = new PatternDescriptor(Patterns.AL.Branch, 7) + { + Example = "1100" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0000000235698741", + LastUpdatedDate = new DateTimeOffset(2011, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2009, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Austria + yield return new IbanCountry("AT") + { + NativeName = "Österreich", + EnglishName = "Austria", + Iban = new PatternDescriptor(Patterns.AT.Iban) + { + Example = "AT611904300234573201" + }, + Bban = new PatternDescriptor(Patterns.AT.Bban, 4) + { + Example = "1904300234573201" + }, + Bank = new PatternDescriptor(Patterns.AT.Bank, 4) + { + Example = "19043" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "BLZ 19043 Kto 234573201", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Azerbaijan + yield return new IbanCountry("AZ") + { + NativeName = "Азәрбајҹан", + EnglishName = "Azerbaijan", + Iban = new PatternDescriptor(Patterns.AZ.Iban) + { + Example = "AZ21NABZ00000000137010001944" + }, + Bban = new PatternDescriptor(Patterns.AZ.Bban, 4) + { + Example = "NABZ00000000137010001944" + }, + Bank = new PatternDescriptor(Patterns.AZ.Bank, 4) + { + Example = "NABZ" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "NABZ00000000137010001944", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2013, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Bosnia and Herzegovina + yield return new IbanCountry("BA") + { + NativeName = "Bosna i Hercegovina", + EnglishName = "Bosnia and Herzegovina", + Iban = new PatternDescriptor(Patterns.BA.Iban) + { + Example = "BA391290079401028494" + }, + Bban = new PatternDescriptor(Patterns.BA.Bban, 4) + { + Example = "1990440001200279" + }, + Bank = new PatternDescriptor(Patterns.BA.Bank, 4) + { + Example = "199" + }, + Branch = new PatternDescriptor(Patterns.BA.Branch, 7) + { + Example = "044" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "199-044-00012002-79", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Belgium + yield return new IbanCountry("BE") + { + NativeName = "België", + EnglishName = "Belgium", + Iban = new PatternDescriptor(Patterns.BE.Iban) + { + Example = "BE68539007547034" + }, + Bban = new PatternDescriptor(Patterns.BE.Bban, 4) + { + Example = "539007547034" + }, + Bank = new PatternDescriptor(Patterns.BE.Bank, 4) + { + Example = "539" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "BE68 5390 0754 7034", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Bulgaria + yield return new IbanCountry("BG") + { + NativeName = "България", + EnglishName = "Bulgaria", + Iban = new PatternDescriptor(Patterns.BG.Iban) + { + Example = "BG80BNBG96611020345678" + }, + Bban = new PatternDescriptor(Patterns.BG.Bban, 4) + { + Example = "BNBG96611020345678" + }, + Bank = new PatternDescriptor(Patterns.BG.Bank, 4) + { + Example = "BNBG" + }, + Branch = new PatternDescriptor(Patterns.BG.Branch, 8) + { + Example = "9661" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Bahrain + yield return new IbanCountry("BH") + { + NativeName = "البحرين", + EnglishName = "Bahrain", + Iban = new PatternDescriptor(Patterns.BH.Iban) + { + Example = "BH67BMAG00001299123456" + }, + Bban = new PatternDescriptor(Patterns.BH.Bban, 4) + { + Example = "BMAG00001299123456" + }, + Bank = new PatternDescriptor(Patterns.BH.Bank, 4) + { + Example = "BMAG" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00001299123456", + LastUpdatedDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Burundi + yield return new IbanCountry("BI") + { + NativeName = "Burundi", + EnglishName = "Burundi", + Iban = new PatternDescriptor(Patterns.BI.Iban) + { + Example = "BI4210000100010000332045181" + }, + Bban = new PatternDescriptor(Patterns.BI.Bban, 4) + { + Example = "10000100010000332045181" + }, + Bank = new PatternDescriptor(Patterns.BI.Bank, 4) + { + Example = "10000" + }, + Branch = new PatternDescriptor(Patterns.BI.Branch, 9) + { + Example = "10001" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00003320451 81", + LastUpdatedDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Brazil + yield return new IbanCountry("BR") + { + NativeName = "Brasil", + EnglishName = "Brazil", + Iban = new PatternDescriptor(Patterns.BR.Iban) + { + Example = "BR1800360305000010009795493C1" + }, + Bban = new PatternDescriptor(Patterns.BR.Bban, 4) + { + Example = "00360305000010009795493P1" + }, + Bank = new PatternDescriptor(Patterns.BR.Bank, 4) + { + Example = "00360305" + }, + Branch = new PatternDescriptor(Patterns.BR.Branch, 12) + { + Example = "00001" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0009795493C1", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2013, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Republic of Belarus + yield return new IbanCountry("BY") + { + NativeName = "Беларусь", + EnglishName = "Republic of Belarus", + Iban = new PatternDescriptor(Patterns.BY.Iban) + { + Example = "BY13NBRB3600900000002Z00AB00" + }, + Bban = new PatternDescriptor(Patterns.BY.Bban, 4) + { + Example = "NBRB3600900000002Z00AB00" + }, + Bank = new PatternDescriptor(Patterns.BY.Bank, 4) + { + Example = "NBRB" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "3600 0000 0000 0Z00 AB00", + LastUpdatedDate = new DateTimeOffset(2024, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2017, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Switzerland + yield return new IbanCountry("CH") + { + NativeName = "Svizzera", + EnglishName = "Switzerland", + Iban = new PatternDescriptor(Patterns.CH.Iban) + { + Example = "CH9300762011623852957" + }, + Bban = new PatternDescriptor(Patterns.CH.Bban, 4) + { + Example = "00762011623852957" + }, + Bank = new PatternDescriptor(Patterns.CH.Bank, 4) + { + Example = "00762" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "762 1162-3852.957", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Costa Rica + yield return new IbanCountry("CR") + { + NativeName = "Costa Rica", + EnglishName = "Costa Rica", + Iban = new PatternDescriptor(Patterns.CR.Iban) + { + Example = "CR05015202001026284066" + }, + Bban = new PatternDescriptor(Patterns.CR.Bban, 4) + { + Example = "15202001026284066" + }, + Bank = new PatternDescriptor(Patterns.CR.Bank, 4) + { + Example = "0152" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "02001026284066", + LastUpdatedDate = new DateTimeOffset(2019, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2011, 6, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Cyprus + yield return new IbanCountry("CY") + { + NativeName = "Κύπρος", + EnglishName = "Cyprus", + Iban = new PatternDescriptor(Patterns.CY.Iban) + { + Example = "CY17002001280000001200527600" + }, + Bban = new PatternDescriptor(Patterns.CY.Bban, 4) + { + Example = "002001280000001200527600" + }, + Bank = new PatternDescriptor(Patterns.CY.Bank, 4) + { + Example = "002" + }, + Branch = new PatternDescriptor(Patterns.CY.Branch, 7) + { + Example = "00128" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "0000001200527600", + LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Czechia + yield return new IbanCountry("CZ") + { + NativeName = "Česko", + EnglishName = "Czechia", + Iban = new PatternDescriptor(Patterns.CZ.Iban) + { + Example = "CZ6508000000192000145399" + }, + Bban = new PatternDescriptor(Patterns.CZ.Bban, 4) + { + Example = "08000000192000145399" + }, + Bank = new PatternDescriptor(Patterns.CZ.Bank, 4) + { + Example = "0800" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "19-2000145399/0800", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Germany + yield return new IbanCountry("DE") + { + NativeName = "Deutschland", + EnglishName = "Germany", + Iban = new PatternDescriptor(Patterns.DE.Iban) + { + Example = "DE89370400440532013000" + }, + Bban = new PatternDescriptor(Patterns.DE.Bban, 4) + { + Example = "370400440532013000" + }, + Bank = new PatternDescriptor(Patterns.DE.Bank, 4) + { + Example = "37040044" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "532013000", + LastUpdatedDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Djibouti + yield return new IbanCountry("DJ") + { + NativeName = "Yabuuti", + EnglishName = "Djibouti", + Iban = new PatternDescriptor(Patterns.DJ.Iban) + { + Example = "DJ2100010000000154000100186" + }, + Bban = new PatternDescriptor(Patterns.DJ.Bban, 4) + { + Example = "00010000000154000100186" + }, + Bank = new PatternDescriptor(Patterns.DJ.Bank, 4) + { + Example = "00010" + }, + Branch = new PatternDescriptor(Patterns.DJ.Branch, 9) + { + Example = "00000" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0154000100186", + LastUpdatedDate = new DateTimeOffset(2022, 5, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2022, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Denmark + yield return new IbanCountry("DK") + { + NativeName = "Danmark", + EnglishName = "Denmark", + Iban = new PatternDescriptor(Patterns.DK.Iban) + { + Example = "DK5000400440116243" + }, + Bban = new PatternDescriptor(Patterns.DK.Bban, 4) + { + Example = "00400440116243" + }, + Bank = new PatternDescriptor(Patterns.DK.Bank, 4) + { + Example = "0040" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "0040 0440116243", + LastUpdatedDate = new DateTimeOffset(2018, 11, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Dominican Republic + yield return new IbanCountry("DO") + { + NativeName = "República Dominicana", + EnglishName = "Dominican Republic", + Iban = new PatternDescriptor(Patterns.DO.Iban) + { + Example = "DO28BAGR00000001212453611324" + }, + Bban = new PatternDescriptor(Patterns.DO.Bban, 4) + { + Example = "BAGR00000001212453611324" + }, + Bank = new PatternDescriptor(Patterns.DO.Bank, 4) + { + Example = "BAGR" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00000001212453611324", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2010, 12, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Estonia + yield return new IbanCountry("EE") + { + NativeName = "Eesti", + EnglishName = "Estonia", + Iban = new PatternDescriptor(Patterns.EE.Iban) + { + Example = "EE382200221020145685" + }, + Bban = new PatternDescriptor(Patterns.EE.Bban, 4) + { + Example = "2200221020145685" + }, + Bank = new PatternDescriptor(Patterns.EE.Bank, 4) + { + Example = "22" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "221020145685", + LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Egypt + yield return new IbanCountry("EG") + { + NativeName = "مصر", + EnglishName = "Egypt", + Iban = new PatternDescriptor(Patterns.EG.Iban) + { + Example = "EG380019000500000000263180002" + }, + Bban = new PatternDescriptor(Patterns.EG.Bban, 4) + { + Example = "0019000500000000263180002" + }, + Bank = new PatternDescriptor(Patterns.EG.Bank, 4) + { + Example = "0019" + }, + Branch = new PatternDescriptor(Patterns.EG.Branch, 8) + { + Example = "0005" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "000263180002", + LastUpdatedDate = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2021, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Spain + yield return new IbanCountry("ES") + { + NativeName = "España", + EnglishName = "Spain", + Iban = new PatternDescriptor(Patterns.ES.Iban) + { + Example = "ES9121000418450200051332" + }, + Bban = new PatternDescriptor(Patterns.ES.Bban, 4) + { + Example = "21000418450200051332" + }, + Bank = new PatternDescriptor(Patterns.ES.Bank, 4) + { + Example = "2100" + }, + Branch = new PatternDescriptor(Patterns.ES.Branch, 8) + { + Example = "0418" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "2100 0418 45 0200051332", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Finland + yield return new IbanCountry("FI") + { + NativeName = "Suomi", + EnglishName = "Finland", + IncludedCountries = ["AX"], + Iban = new PatternDescriptor(Patterns.FI.Iban) + { + Example = "FI2112345600000785" + }, + Bban = new PatternDescriptor(Patterns.FI.Bban, 4) + { + Example = "12345600000785" + }, + Bank = new PatternDescriptor(Patterns.FI.Bank, 4) + { + Example = "123456" + }, + Sepa = new SepaInfo + { + IsMember = true, + IncludedCountries = ["AX"] + }, + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2011, 12, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Falkland Islands + yield return new IbanCountry("FK") + { + NativeName = "Falkland Islands", + EnglishName = "Falkland Islands", + Iban = new PatternDescriptor(Patterns.FK.Iban) + { + Example = "FK88SC123456789012" + }, + Bban = new PatternDescriptor(Patterns.FK.Bban, 4) + { + Example = "SC123456789012" + }, + Bank = new PatternDescriptor(Patterns.FK.Bank, 4) + { + Example = "SC" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "123456789012", + LastUpdatedDate = new DateTimeOffset(2023, 7, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2023, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Faroe Islands + yield return new IbanCountry("FO") + { + NativeName = "Føroyar", + EnglishName = "Faroe Islands", + Iban = new PatternDescriptor(Patterns.FO.Iban) + { + Example = "FO6264600001631634" + }, + Bban = new PatternDescriptor(Patterns.FO.Bban, 4) + { + Example = "64600001631634" + }, + Bank = new PatternDescriptor(Patterns.FO.Bank, 4) + { + Example = "6460" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "6460 0001631634", + LastUpdatedDate = new DateTimeOffset(2017, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // France + yield return new IbanCountry("FR") + { + NativeName = "France", + EnglishName = "France", + IncludedCountries = ["GF", "GP", "MQ", "RE", "PF", "TF", "YT", "NC", "BL", "MF", "PM", "WF"], + Iban = new PatternDescriptor(Patterns.FR.Iban) + { + Example = "FR1420041010050500013M02606" + }, + Bban = new PatternDescriptor(Patterns.FR.Bban, 4) + { + Example = "20041010050500013M02606" + }, + Bank = new PatternDescriptor(Patterns.FR.Bank, 4) + { + Example = "20041" + }, + Branch = new PatternDescriptor(Patterns.FR.Branch, 9) + { + Example = "01005" + }, + Sepa = new SepaInfo + { + IsMember = true, + IncludedCountries = ["GF", "GP", "MQ", "YT", "RE", "PM", "BL", "MF"] + }, + DomesticAccountNumberExample = "20041 01005 0500013M026 06", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // United Kingdom + yield return new IbanCountry("GB") + { + NativeName = "United Kingdom", + EnglishName = "United Kingdom", + IncludedCountries = ["IM", "JE", "GG"], + Iban = new PatternDescriptor(Patterns.GB.Iban) + { + Example = "GB29NWBK60161331926819" + }, + Bban = new PatternDescriptor(Patterns.GB.Bban, 4) + { + Example = "NWBK60161331926819" + }, + Bank = new PatternDescriptor(Patterns.GB.Bank, 4) + { + Example = "NWBK" + }, + Branch = new PatternDescriptor(Patterns.GB.Branch, 8) + { + Example = "601613" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "60-16-13 31926819", + LastUpdatedDate = new DateTimeOffset(2017, 5, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Georgia + yield return new IbanCountry("GE") + { + NativeName = "საქართველო", + EnglishName = "Georgia", + Iban = new PatternDescriptor(Patterns.GE.Iban) + { + Example = "GE29NB0000000101904917" + }, + Bban = new PatternDescriptor(Patterns.GE.Bban, 4) + { + Example = "NB0000000101904917" + }, + Bank = new PatternDescriptor(Patterns.GE.Bank, 4) + { + Example = "NB" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0000000101904917", + LastUpdatedDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2010, 5, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Gibraltar + yield return new IbanCountry("GI") + { + NativeName = "Gibraltar", + EnglishName = "Gibraltar", + Iban = new PatternDescriptor(Patterns.GI.Iban) + { + Example = "GI75NWBK000000007099453" + }, + Bban = new PatternDescriptor(Patterns.GI.Bban, 4) + { + Example = "NWBK000000007099453" + }, + Bank = new PatternDescriptor(Patterns.GI.Bank, 4) + { + Example = "NWBK" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "0000 00007099 453", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Greenland + yield return new IbanCountry("GL") + { + NativeName = "Kalaallit Nunaat", + EnglishName = "Greenland", + Iban = new PatternDescriptor(Patterns.GL.Iban) + { + Example = "GL8964710001000206" + }, + Bban = new PatternDescriptor(Patterns.GL.Bban, 4) + { + Example = "64710001000206" + }, + Bank = new PatternDescriptor(Patterns.GL.Bank, 4) + { + Example = "6471" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "6471 0001000206", + LastUpdatedDate = new DateTimeOffset(2017, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Greece + yield return new IbanCountry("GR") + { + NativeName = "Ελλάδα", + EnglishName = "Greece", + Iban = new PatternDescriptor(Patterns.GR.Iban) + { + Example = "GR1601101250000000012300695" + }, + Bban = new PatternDescriptor(Patterns.GR.Bban, 4) + { + Example = "01101250000000012300695" + }, + Bank = new PatternDescriptor(Patterns.GR.Bank, 4) + { + Example = "011" + }, + Branch = new PatternDescriptor(Patterns.GR.Branch, 7) + { + Example = "0125" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "01250000000012300695", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Guatemala + yield return new IbanCountry("GT") + { + NativeName = "Guatemala", + EnglishName = "Guatemala", + Iban = new PatternDescriptor(Patterns.GT.Iban) + { + Example = "GT82TRAJ01020000001210029690" + }, + Bban = new PatternDescriptor(Patterns.GT.Bban, 4) + { + Example = "TRAJ01020000001210029690" + }, + Bank = new PatternDescriptor(Patterns.GT.Bank, 4) + { + Example = "TRAJ" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "01020000001210029690", + LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Honduras + yield return new IbanCountry("HN") + { + NativeName = "Honduras", + EnglishName = "Honduras", + Iban = new PatternDescriptor(Patterns.HN.Iban) + { + Example = "HN88CABF00000000000250005469" + }, + Bban = new PatternDescriptor(Patterns.HN.Bban, 4) + { + Example = "CABF00000000000250005469" + }, + Bank = new PatternDescriptor(Patterns.HN.Bank, 4) + { + Example = "CABF" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "250005469", + LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2024, 10, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Croatia + yield return new IbanCountry("HR") + { + NativeName = "Hrvatska", + EnglishName = "Croatia", + Iban = new PatternDescriptor(Patterns.HR.Iban) + { + Example = "HR1210010051863000160" + }, + Bban = new PatternDescriptor(Patterns.HR.Bban, 4) + { + Example = "10010051863000160" + }, + Bank = new PatternDescriptor(Patterns.HR.Bank, 4) + { + Example = "1001005" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "1001005-1863000160", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Hungary + yield return new IbanCountry("HU") + { + NativeName = "Magyarország", + EnglishName = "Hungary", + Iban = new PatternDescriptor(Patterns.HU.Iban) + { + Example = "HU42117730161111101800000000" + }, + Bban = new PatternDescriptor(Patterns.HU.Bban, 4) + { + Example = "117730161111101800000000" + }, + Bank = new PatternDescriptor(Patterns.HU.Bank, 4) + { + Example = "117" + }, + Branch = new PatternDescriptor(Patterns.HU.Branch, 7) + { + Example = "7301" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "11773016-11111018-00000000", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Ireland + yield return new IbanCountry("IE") + { + NativeName = "Ireland", + EnglishName = "Ireland", + Iban = new PatternDescriptor(Patterns.IE.Iban) + { + Example = "IE29AIBK93115212345678" + }, + Bban = new PatternDescriptor(Patterns.IE.Bban, 4) + { + Example = "AIBK93115212345678" + }, + Bank = new PatternDescriptor(Patterns.IE.Bank, 4) + { + Example = "AIBK" + }, + Branch = new PatternDescriptor(Patterns.IE.Branch, 8) + { + Example = "931152" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "93-11-52 12345678", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Israel + yield return new IbanCountry("IL") + { + NativeName = "ישראל", + EnglishName = "Israel", + Iban = new PatternDescriptor(Patterns.IL.Iban) + { + Example = "IL620108000000099999999" + }, + Bban = new PatternDescriptor(Patterns.IL.Bban, 4) + { + Example = "010800000099999999" + }, + Bank = new PatternDescriptor(Patterns.IL.Bank, 4) + { + Example = "010" + }, + Branch = new PatternDescriptor(Patterns.IL.Branch, 7) + { + Example = "800" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "10-800-99999999", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Iraq + yield return new IbanCountry("IQ") + { + NativeName = "العراق", + EnglishName = "Iraq", + Iban = new PatternDescriptor(Patterns.IQ.Iban) + { + Example = "IQ98NBIQ850123456789012" + }, + Bban = new PatternDescriptor(Patterns.IQ.Bban, 4) + { + Example = "NBIQ850123456789012" + }, + Bank = new PatternDescriptor(Patterns.IQ.Bank, 4) + { + Example = "NBIQ" + }, + Branch = new PatternDescriptor(Patterns.IQ.Branch, 8) + { + Example = "850" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "123456789012", + LastUpdatedDate = new DateTimeOffset(2016, 11, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2017, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Iceland + yield return new IbanCountry("IS") + { + NativeName = "Ísland", + EnglishName = "Iceland", + Iban = new PatternDescriptor(Patterns.IS.Iban) + { + Example = "IS140159260076545510730339" + }, + Bban = new PatternDescriptor(Patterns.IS.Bban, 4) + { + Example = "0159260076545510730339" + }, + Bank = new PatternDescriptor(Patterns.IS.Bank, 4) + { + Example = "01" + }, + Branch = new PatternDescriptor(Patterns.IS.Branch, 6) + { + Example = "59" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "0159-26-007654-551073-0339", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Italy + yield return new IbanCountry("IT") + { + NativeName = "Italia", + EnglishName = "Italy", + Iban = new PatternDescriptor(Patterns.IT.Iban) + { + Example = "IT60X0542811101000000123456" + }, + Bban = new PatternDescriptor(Patterns.IT.Bban, 4) + { + Example = "X0542811101000000123456" + }, + Bank = new PatternDescriptor(Patterns.IT.Bank, 5) + { + Example = "05428" + }, + Branch = new PatternDescriptor(Patterns.IT.Branch, 10) + { + Example = "11101" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "X 05428 11101 000000123456", + LastUpdatedDate = new DateTimeOffset(2013, 3, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Jordan + yield return new IbanCountry("JO") + { + NativeName = "الأردن", + EnglishName = "Jordan", + Iban = new PatternDescriptor(Patterns.JO.Iban) + { + Example = "JO94CBJO0010000000000131000302" + }, + Bban = new PatternDescriptor(Patterns.JO.Bban, 4) + { + Example = "CBJO0010000000000131000302" + }, + Bank = new PatternDescriptor(Patterns.JO.Bank, 8) + { + Example = "CBJO" + }, + Branch = new PatternDescriptor(Patterns.JO.Branch, 8), + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0001310000302", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2014, 2, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Kuwait + yield return new IbanCountry("KW") + { + NativeName = "الكويت", + EnglishName = "Kuwait", + Iban = new PatternDescriptor(Patterns.KW.Iban) + { + Example = "KW81CBKU0000000000001234560101" + }, + Bban = new PatternDescriptor(Patterns.KW.Bban, 4) + { + Example = "CBKU0000000000001234560101" + }, + Bank = new PatternDescriptor(Patterns.KW.Bank, 4) + { + Example = "CBKU" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "1234560101", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Kazakhstan + yield return new IbanCountry("KZ") + { + NativeName = "Қазақстан", + EnglishName = "Kazakhstan", + Iban = new PatternDescriptor(Patterns.KZ.Iban) + { + Example = "KZ86125KZT5004100100" + }, + Bban = new PatternDescriptor(Patterns.KZ.Bban, 4) + { + Example = "125KZT5004100100" + }, + Bank = new PatternDescriptor(Patterns.KZ.Bank, 4) + { + Example = "125" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "KZ86 125K ZT50 0410 0100", + LastUpdatedDate = new DateTimeOffset(2016, 3, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2010, 9, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Lebanon + yield return new IbanCountry("LB") + { + NativeName = "لبنان", + EnglishName = "Lebanon", + Iban = new PatternDescriptor(Patterns.LB.Iban) + { + Example = "LB62099900000001001901229114" + }, + Bban = new PatternDescriptor(Patterns.LB.Bban, 4) + { + Example = "099900000001001901229114" + }, + Bank = new PatternDescriptor(Patterns.LB.Bank, 4) + { + Example = "0999" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "01 001 901229114", + LastUpdatedDate = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Saint Lucia + yield return new IbanCountry("LC") + { + NativeName = "St. Lucia", + EnglishName = "Saint Lucia", + Iban = new PatternDescriptor(Patterns.LC.Iban) + { + Example = "LC55HEMM000100010012001200023015" + }, + Bban = new PatternDescriptor(Patterns.LC.Bban, 4) + { + Example = "HEMM000100010012001200023015" + }, + Bank = new PatternDescriptor(Patterns.LC.Bank, 4) + { + Example = "HEMM" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0001 0001 0012 0012 0002 3015", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Liechtenstein + yield return new IbanCountry("LI") + { + NativeName = "Liechtenstein", + EnglishName = "Liechtenstein", + Iban = new PatternDescriptor(Patterns.LI.Iban) + { + Example = "LI21088100002324013AA" + }, + Bban = new PatternDescriptor(Patterns.LI.Bban, 4) + { + Example = "088100002324013AA" + }, + Bank = new PatternDescriptor(Patterns.LI.Bank, 4) + { + Example = "08810" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "8810 2324013AA", + LastUpdatedDate = new DateTimeOffset(2012, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Lithuania + yield return new IbanCountry("LT") + { + NativeName = "Lietuva", + EnglishName = "Lithuania", + Iban = new PatternDescriptor(Patterns.LT.Iban) + { + Example = "LT121000011101001000" + }, + Bban = new PatternDescriptor(Patterns.LT.Bban, 4) + { + Example = "1000011101001000" + }, + Bank = new PatternDescriptor(Patterns.LT.Bank, 4) + { + Example = "10000" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Luxembourg + yield return new IbanCountry("LU") + { + NativeName = "Lëtzebuerg", + EnglishName = "Luxembourg", + Iban = new PatternDescriptor(Patterns.LU.Iban) + { + Example = "LU280019400644750000" + }, + Bban = new PatternDescriptor(Patterns.LU.Bban, 4) + { + Example = "0019400644750000" + }, + Bank = new PatternDescriptor(Patterns.LU.Bank, 4) + { + Example = "001" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Latvia + yield return new IbanCountry("LV") + { + NativeName = "Latvija", + EnglishName = "Latvia", + Iban = new PatternDescriptor(Patterns.LV.Iban) + { + Example = "LV80BANK0000435195001" + }, + Bban = new PatternDescriptor(Patterns.LV.Bban, 4) + { + Example = "BANK0000435195001" + }, + Bank = new PatternDescriptor(Patterns.LV.Bank, 4) + { + Example = "BANK" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "LV80 BANK 0000 4351 9500 1", + LastUpdatedDate = new DateTimeOffset(2009, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Libya + yield return new IbanCountry("LY") + { + NativeName = "ليبيا", + EnglishName = "Libya", + Iban = new PatternDescriptor(Patterns.LY.Iban) + { + Example = "LY83002048000020100120361" + }, + Bban = new PatternDescriptor(Patterns.LY.Bban, 4) + { + Example = "002048000020100120361" + }, + Bank = new PatternDescriptor(Patterns.LY.Bank, 4) + { + Example = "002" + }, + Branch = new PatternDescriptor(Patterns.LY.Branch, 7) + { + Example = "048" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "000020100120361", + LastUpdatedDate = new DateTimeOffset(2020, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2021, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Monaco + yield return new IbanCountry("MC") + { + NativeName = "Monaco", + EnglishName = "Monaco", + Iban = new PatternDescriptor(Patterns.MC.Iban) + { + Example = "MC5811222000010123456789030" + }, + Bban = new PatternDescriptor(Patterns.MC.Bban, 4) + { + Example = "11222000010123456789030" + }, + Bank = new PatternDescriptor(Patterns.MC.Bank, 4) + { + Example = "11222" + }, + Branch = new PatternDescriptor(Patterns.MC.Branch, 9) + { + Example = "00001" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "0011111000h", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2008, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Moldova + yield return new IbanCountry("MD") + { + NativeName = "Republica Moldova", + EnglishName = "Moldova", + Iban = new PatternDescriptor(Patterns.MD.Iban) + { + Example = "MD24AG000225100013104168" + }, + Bban = new PatternDescriptor(Patterns.MD.Bban, 4) + { + Example = "AG000225100013104168" + }, + Bank = new PatternDescriptor(Patterns.MD.Bank, 4) + { + Example = "AG" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "000225100013104168", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Montenegro + yield return new IbanCountry("ME") + { + NativeName = "Crna Gora", + EnglishName = "Montenegro", + Iban = new PatternDescriptor(Patterns.ME.Iban) + { + Example = "ME25505000012345678951" + }, + Bban = new PatternDescriptor(Patterns.ME.Bban, 4) + { + Example = "505000012345678951" + }, + Bank = new PatternDescriptor(Patterns.ME.Bank, 4) + { + Example = "505" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "505 0000123456789 51", + LastUpdatedDate = new DateTimeOffset(2010, 5, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Macedonia + yield return new IbanCountry("MK") + { + NativeName = "Северна Македонија", + EnglishName = "Macedonia", + Iban = new PatternDescriptor(Patterns.MK.Iban) + { + Example = "MK07250120000058984" + }, + Bban = new PatternDescriptor(Patterns.MK.Bban, 4) + { + Example = "250120000058984" + }, + Bank = new PatternDescriptor(Patterns.MK.Bank, 4) + { + Example = "300" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "MK07 300 0000000424 25", + LastUpdatedDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Mongolia + yield return new IbanCountry("MN") + { + NativeName = "Монгол", + EnglishName = "Mongolia", + Iban = new PatternDescriptor(Patterns.MN.Iban) + { + Example = "MN121234123456789123" + }, + Bban = new PatternDescriptor(Patterns.MN.Bban, 4) + { + Example = "1234123456789123" + }, + Bank = new PatternDescriptor(Patterns.MN.Bank, 4) + { + Example = "1234" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "1234 5678 9123", + LastUpdatedDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Mauritania + yield return new IbanCountry("MR") + { + NativeName = "موريتانيا", + EnglishName = "Mauritania", + Iban = new PatternDescriptor(Patterns.MR.Iban) + { + Example = "MR1300020001010000123456753" + }, + Bban = new PatternDescriptor(Patterns.MR.Bban, 4) + { + Example = "00020001010000123456753" + }, + Bank = new PatternDescriptor(Patterns.MR.Bank, 4) + { + Example = "00020" + }, + Branch = new PatternDescriptor(Patterns.MR.Branch, 9) + { + Example = "00101" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00020 00101 00001234567 53", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Malta + yield return new IbanCountry("MT") + { + NativeName = "Malta", + EnglishName = "Malta", + Iban = new PatternDescriptor(Patterns.MT.Iban) + { + Example = "MT84MALT011000012345MTLCAST001S" + }, + Bban = new PatternDescriptor(Patterns.MT.Bban, 4) + { + Example = "MALT011000012345MTLCAST001S" + }, + Bank = new PatternDescriptor(Patterns.MT.Bank, 4) + { + Example = "MALT" + }, + Branch = new PatternDescriptor(Patterns.MT.Branch, 8) + { + Example = "01100" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "12345MTLCAST001S", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Mauritius + yield return new IbanCountry("MU") + { + NativeName = "Mauritius", + EnglishName = "Mauritius", + Iban = new PatternDescriptor(Patterns.MU.Iban) + { + Example = "MU17BOMM0101101030300200000MUR" + }, + Bban = new PatternDescriptor(Patterns.MU.Bban, 4) + { + Example = "BOMM0101101030300200000MUR" + }, + Bank = new PatternDescriptor(Patterns.MU.Bank, 4) + { + Example = "BOMM01" + }, + Branch = new PatternDescriptor(Patterns.MU.Branch, 10) + { + Example = "01" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "MU17 BOMM 0101 1010 3030 0200 000M UR", + LastUpdatedDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Nicaragua + yield return new IbanCountry("NI") + { + NativeName = "Nicaragua", + EnglishName = "Nicaragua", + Iban = new PatternDescriptor(Patterns.NI.Iban) + { + Example = "NI45BAPR00000013000003558124" + }, + Bban = new PatternDescriptor(Patterns.NI.Bban, 4) + { + Example = "BAPR00000013000003558124" + }, + Bank = new PatternDescriptor(Patterns.NI.Bank, 4) + { + Example = "BAPR" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00000013000003558124", + LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Netherlands (The) + yield return new IbanCountry("NL") + { + NativeName = "Nederland", + EnglishName = "Netherlands (The)", + Iban = new PatternDescriptor(Patterns.NL.Iban) + { + Example = "NL91ABNA0417164300" + }, + Bban = new PatternDescriptor(Patterns.NL.Bban, 4) + { + Example = "ABNA0417164300" + }, + Bank = new PatternDescriptor(Patterns.NL.Bank, 4) + { + Example = "ABNA" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "041 71 64 300", + LastUpdatedDate = new DateTimeOffset(2020, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Norway + yield return new IbanCountry("NO") + { + NativeName = "Noreg", + EnglishName = "Norway", + Iban = new PatternDescriptor(Patterns.NO.Iban) + { + Example = "NO9386011117947" + }, + Bban = new PatternDescriptor(Patterns.NO.Bban, 4) + { + Example = "86011117947" + }, + Bank = new PatternDescriptor(Patterns.NO.Bank, 4) + { + Example = "8601" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "8601 11 17947", + LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Oman + yield return new IbanCountry("OM") + { + NativeName = "عمان", + EnglishName = "Oman", + Iban = new PatternDescriptor(Patterns.OM.Iban) + { + Example = "OM810180000001299123456" + }, + Bban = new PatternDescriptor(Patterns.OM.Bban, 4) + { + Example = "0180000001299123456" + }, + Bank = new PatternDescriptor(Patterns.OM.Bank, 4) + { + Example = "018" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0000001299123456", + LastUpdatedDate = new DateTimeOffset(2024, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2024, 3, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Pakistan + yield return new IbanCountry("PK") + { + NativeName = "پاکستان", + EnglishName = "Pakistan", + Iban = new PatternDescriptor(Patterns.PK.Iban) + { + Example = "PK36SCBL0000001123456702" + }, + Bban = new PatternDescriptor(Patterns.PK.Bban, 4) + { + Example = "SCBL0000001123456702" + }, + Bank = new PatternDescriptor(Patterns.PK.Bank, 4) + { + Example = "SCBL" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00260101036360", + LastUpdatedDate = new DateTimeOffset(2012, 12, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2012, 12, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Poland + yield return new IbanCountry("PL") + { + NativeName = "Polska", + EnglishName = "Poland", + Iban = new PatternDescriptor(Patterns.PL.Iban) + { + Example = "PL61109010140000071219812874" + }, + Bban = new PatternDescriptor(Patterns.PL.Bban, 4) + { + Example = "109010140000071219812874" + }, + Branch = new PatternDescriptor(Patterns.PL.Branch, 4) + { + Example = "10901014" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "61 1090 1014 0000 0712 1981 2874", + LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Palestine, State of + yield return new IbanCountry("PS") + { + NativeName = "السلطة الفلسطينية", + EnglishName = "Palestine, State of", + Iban = new PatternDescriptor(Patterns.PS.Iban) + { + Example = "PS92PALS000000000400123456702" + }, + Bban = new PatternDescriptor(Patterns.PS.Bban, 4) + { + Example = "PALS000000000400123456702" + }, + Bank = new PatternDescriptor(Patterns.PS.Bank, 4) + { + Example = "PALS" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "400123456702", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2012, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Portugal + yield return new IbanCountry("PT") + { + NativeName = "Portugal", + EnglishName = "Portugal", + Iban = new PatternDescriptor(Patterns.PT.Iban) + { + Example = "PT50000201231234567890154" + }, + Bban = new PatternDescriptor(Patterns.PT.Bban, 4) + { + Example = "000201231234567890154" + }, + Bank = new PatternDescriptor(Patterns.PT.Bank, 4) + { + Example = "0002" + }, + Branch = new PatternDescriptor(Patterns.PT.Branch, 8) + { + Example = "0123" + }, + Sepa = new SepaInfo + { + IsMember = true, + IncludedCountries = ["AZ", "MA"] + }, + DomesticAccountNumberExample = "0002.0123.12345678901.54", + LastUpdatedDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Qatar + yield return new IbanCountry("QA") + { + NativeName = "قطر", + EnglishName = "Qatar", + Iban = new PatternDescriptor(Patterns.QA.Iban) + { + Example = "QA58DOHB00001234567890ABCDEFG" + }, + Bban = new PatternDescriptor(Patterns.QA.Bban, 4) + { + Example = "DOHB00001234567890ABCDEFG" + }, + Bank = new PatternDescriptor(Patterns.QA.Bank, 4) + { + Example = "DOHB" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00001234567890ABCDEFG", + LastUpdatedDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Romania + yield return new IbanCountry("RO") + { + NativeName = "România", + EnglishName = "Romania", + Iban = new PatternDescriptor(Patterns.RO.Iban) + { + Example = "RO49AAAA1B31007593840000" + }, + Bban = new PatternDescriptor(Patterns.RO.Bban, 4) + { + Example = "AAAA1B31007593840000" + }, + Bank = new PatternDescriptor(Patterns.RO.Bank, 4) + { + Example = "AAAA" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "RO49 AAAA 1B31 0075 9384 0000", + LastUpdatedDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Serbia + yield return new IbanCountry("RS") + { + NativeName = "Srbija", + EnglishName = "Serbia", + Iban = new PatternDescriptor(Patterns.RS.Iban) + { + Example = "RS35260005601001611379" + }, + Bban = new PatternDescriptor(Patterns.RS.Bban, 4) + { + Example = "260005601001611379" + }, + Bank = new PatternDescriptor(Patterns.RS.Bank, 4) + { + Example = "260" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "260-0056010016113-79", + LastUpdatedDate = new DateTimeOffset(2017, 3, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Saudi Arabia + yield return new IbanCountry("SA") + { + NativeName = "المملكة العربية السعودية", + EnglishName = "Saudi Arabia", + Iban = new PatternDescriptor(Patterns.SA.Iban) + { + Example = "SA0380000000608010167519" + }, + Bban = new PatternDescriptor(Patterns.SA.Bban, 4) + { + Example = "80000000608010167519" + }, + Bank = new PatternDescriptor(Patterns.SA.Bank, 4) + { + Example = "80" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "608010167519", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Seychelles + yield return new IbanCountry("SC") + { + NativeName = "Seychelles", + EnglishName = "Seychelles", + Iban = new PatternDescriptor(Patterns.SC.Iban) + { + Example = "SC18SSCB11010000000000001497USD" + }, + Bban = new PatternDescriptor(Patterns.SC.Bban, 4) + { + Example = "SSCB11010000000000001497USD" + }, + Bank = new PatternDescriptor(Patterns.SC.Bank, 4) + { + Example = "SSCB11" + }, + Branch = new PatternDescriptor(Patterns.SC.Branch, 10) + { + Example = "01" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0000000000001497", + LastUpdatedDate = new DateTimeOffset(2019, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Sudan + yield return new IbanCountry("SD") + { + NativeName = "السودان", + EnglishName = "Sudan", + Iban = new PatternDescriptor(Patterns.SD.Iban) + { + Example = "SD2129010501234001" + }, + Bban = new PatternDescriptor(Patterns.SD.Bban, 4) + { + Example = "29010501234001" + }, + Bank = new PatternDescriptor(Patterns.SD.Bank, 4) + { + Example = "29" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "010501234001", + LastUpdatedDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2021, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Sweden + yield return new IbanCountry("SE") + { + NativeName = "Sverige", + EnglishName = "Sweden", + Iban = new PatternDescriptor(Patterns.SE.Iban) + { + Example = "SE4550000000058398257466" + }, + Bban = new PatternDescriptor(Patterns.SE.Bban, 4) + { + Example = "50000000058398257466" + }, + Bank = new PatternDescriptor(Patterns.SE.Bank, 4) + { + Example = "123" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "1234 12 3456 1", + LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Slovenia + yield return new IbanCountry("SI") + { + NativeName = "Slovenija", + EnglishName = "Slovenia", + Iban = new PatternDescriptor(Patterns.SI.Iban) + { + Example = "SI56263300012039086" + }, + Bban = new PatternDescriptor(Patterns.SI.Bban, 4) + { + Example = "263300012039086" + }, + Bank = new PatternDescriptor(Patterns.SI.Bank, 4) + { + Example = "26330" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "2633 0001 2039 086", + LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Slovakia + yield return new IbanCountry("SK") + { + NativeName = "Slovensko", + EnglishName = "Slovakia", + Iban = new PatternDescriptor(Patterns.SK.Iban) + { + Example = "SK3112000000198742637541" + }, + Bban = new PatternDescriptor(Patterns.SK.Bban, 4) + { + Example = "12000000198742637541" + }, + Bank = new PatternDescriptor(Patterns.SK.Bank, 4) + { + Example = "1200" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "19-8742637541/1200", + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // San Marino + yield return new IbanCountry("SM") + { + NativeName = "San Marino", + EnglishName = "San Marino", + Iban = new PatternDescriptor(Patterns.SM.Iban) + { + Example = "SM86U0322509800000000270100" + }, + Bban = new PatternDescriptor(Patterns.SM.Bban, 4) + { + Example = "U0322509800000000270100" + }, + Bank = new PatternDescriptor(Patterns.SM.Bank, 5) + { + Example = "03225" + }, + Branch = new PatternDescriptor(Patterns.SM.Branch, 10) + { + Example = "09800" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 8, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Somalia + yield return new IbanCountry("SO") + { + NativeName = "الصومال", + EnglishName = "Somalia", + Iban = new PatternDescriptor(Patterns.SO.Iban) + { + Example = "SO211000001001000100141" + }, + Bban = new PatternDescriptor(Patterns.SO.Bban, 4) + { + Example = "1000001001000100141" + }, + Bank = new PatternDescriptor(Patterns.SO.Bank, 4) + { + Example = "1000" + }, + Branch = new PatternDescriptor(Patterns.SO.Branch, 8) + { + Example = "001" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "001000100141", + LastUpdatedDate = new DateTimeOffset(2023, 2, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2023, 1, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Sao Tome and Principe + yield return new IbanCountry("ST") + { + NativeName = "São Tomé e Príncipe", + EnglishName = "Sao Tome and Principe", + Iban = new PatternDescriptor(Patterns.ST.Iban) + { + Example = "ST23000100010051845310146" + }, + Bban = new PatternDescriptor(Patterns.ST.Bban, 4) + { + Example = "000100010051845310146" + }, + Bank = new PatternDescriptor(Patterns.ST.Bank, 4) + { + Example = "0001" + }, + Branch = new PatternDescriptor(Patterns.ST.Branch, 8) + { + Example = "0001" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "0051845310146", + LastUpdatedDate = new DateTimeOffset(2020, 5, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2020, 3, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // El Salvador + yield return new IbanCountry("SV") + { + NativeName = "El Salvador", + EnglishName = "El Salvador", + Iban = new PatternDescriptor(Patterns.SV.Iban) + { + Example = "SV62CENR00000000000000700025" + }, + Bban = new PatternDescriptor(Patterns.SV.Bban, 4) + { + Example = "CENR00000000000000700025" + }, + Bank = new PatternDescriptor(Patterns.SV.Bank, 4) + { + Example = "CENR" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00000000000000700025", + LastUpdatedDate = new DateTimeOffset(2021, 3, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 12, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Timor-Leste + yield return new IbanCountry("TL") + { + NativeName = "Timor-Leste", + EnglishName = "Timor-Leste", + Iban = new PatternDescriptor(Patterns.TL.Iban) + { + Example = "TL380080012345678910157" + }, + Bban = new PatternDescriptor(Patterns.TL.Bban, 4) + { + Example = "0080012345678910157" + }, + Bank = new PatternDescriptor(Patterns.TL.Bank, 4) + { + Example = "008" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "008 00123456789101 57", + LastUpdatedDate = new DateTimeOffset(2014, 11, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2014, 9, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Tunisia + yield return new IbanCountry("TN") + { + NativeName = "تونس", + EnglishName = "Tunisia", + Iban = new PatternDescriptor(Patterns.TN.Iban) + { + Example = "TN5910006035183598478831" + }, + Bban = new PatternDescriptor(Patterns.TN.Bban, 4) + { + Example = "10006035183598478831" + }, + Bank = new PatternDescriptor(Patterns.TN.Bank, 4) + { + Example = "10" + }, + Branch = new PatternDescriptor(Patterns.TN.Branch, 6) + { + Example = "006" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "10 006 0351835984788 31", + LastUpdatedDate = new DateTimeOffset(2016, 5, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Turkey + yield return new IbanCountry("TR") + { + NativeName = "Türkiye", + EnglishName = "Turkey", + Iban = new PatternDescriptor(Patterns.TR.Iban) + { + Example = "TR330006100519786457841326" + }, + Bban = new PatternDescriptor(Patterns.TR.Bban, 4) + { + Example = "0006100519786457841326" + }, + Bank = new PatternDescriptor(Patterns.TR.Bank, 4) + { + Example = "00061" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Ukraine + yield return new IbanCountry("UA") + { + NativeName = "Україна", + EnglishName = "Ukraine", + Iban = new PatternDescriptor(Patterns.UA.Iban) + { + Example = "UA213223130000026007233566001" + }, + Bban = new PatternDescriptor(Patterns.UA.Bban, 4) + { + Example = "3223130000026007233566001" + }, + Bank = new PatternDescriptor(Patterns.UA.Bank, 4) + { + Example = "322313" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "26007233566001", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2016, 2, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Vatican City State + yield return new IbanCountry("VA") + { + NativeName = "Città del Vaticano", + EnglishName = "Vatican City State", + Iban = new PatternDescriptor(Patterns.VA.Iban) + { + Example = "VA59001123000012345678" + }, + Bban = new PatternDescriptor(Patterns.VA.Bban, 4) + { + Example = "001123000012345678" + }, + Bank = new PatternDescriptor(Patterns.VA.Bank, 4) + { + Example = "001" + }, + Sepa = new SepaInfo + { + IsMember = true + }, + DomesticAccountNumberExample = "123000012345678", + LastUpdatedDate = new DateTimeOffset(2018, 12, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2019, 3, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Virgin Islands + yield return new IbanCountry("VG") + { + NativeName = "British Virgin Islands", + EnglishName = "Virgin Islands", + Iban = new PatternDescriptor(Patterns.VG.Iban) + { + Example = "VG96VPVG0000012345678901" + }, + Bban = new PatternDescriptor(Patterns.VG.Bban, 4) + { + Example = "VPVG0000012345678901" + }, + Bank = new PatternDescriptor(Patterns.VG.Bank, 4) + { + Example = "VPVG" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "00000 12 345 678 901", + LastUpdatedDate = new DateTimeOffset(2014, 6, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2012, 4, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Kosovo + yield return new IbanCountry("XK") + { + NativeName = "Kosovë", + EnglishName = "Kosovo", + Iban = new PatternDescriptor(Patterns.XK.Iban) + { + Example = "XK051212012345678906" + }, + Bban = new PatternDescriptor(Patterns.XK.Bban, 4) + { + Example = "1212012345678906" + }, + Bank = new PatternDescriptor(Patterns.XK.Bank, 4) + { + Example = "12" + }, + Branch = new PatternDescriptor(Patterns.XK.Branch, 6) + { + Example = "12" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "1212 0123456789 06", + LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2014, 9, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // Yemen + yield return new IbanCountry("YE") + { + NativeName = "اليمن", + EnglishName = "Yemen", + Iban = new PatternDescriptor(Patterns.YE.Iban) + { + Example = "YE15CBYE0001018861234567891234" + }, + Bban = new PatternDescriptor(Patterns.YE.Bban, 4) + { + Example = "CBYE0001018861234567891234" + }, + Bank = new PatternDescriptor(Patterns.YE.Bank, 4) + { + Example = "CBYE" + }, + Branch = new PatternDescriptor(Patterns.YE.Branch, 8) + { + Example = "0001" + }, + Sepa = new SepaInfo + { + IsMember = false + }, + DomesticAccountNumberExample = "018861234567891234", + LastUpdatedDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero), + EffectiveDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero) + }; + + // ReSharper restore StringLiteralTypo + // ReSharper restore CommentTypo + } + + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + private static class Patterns + { + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal class Pattern : IbanNet.Registry.Patterns.Pattern + { + public Pattern(string pattern, int maxLength, bool isFixedLength, PatternToken[] tokens) + : base(pattern, maxLength, isFixedLength, tokens) + { + } + } + + // Andorra + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("AD2!n4!n4!n12!c", 24, true, + [ + new PatternToken("AD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n4!n12!c", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // United Arab Emirates (The) + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("AE2!n3!n16!n", 23, true, + [ + new PatternToken("AE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n16!n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Albania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("AL2!n8!n16!c", 28, true, + [ + new PatternToken("AL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8!n16!c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("8!n", 8, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Austria + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("AT2!n5!n11!n", 20, true, + [ + new PatternToken("AT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n11!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Azerbaijan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("AZ2!n4!a20!c", 28, true, + [ + new PatternToken("AZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a20!c", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Bosnia and Herzegovina + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BA2!n3!n3!n8!n2!n", 20, true, + [ + new PatternToken("BA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n3!n8!n2!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Belgium + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BE2!n3!n7!n2!n", 16, true, + [ + new PatternToken("BE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n7!n2!n", 12, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Bulgaria + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BG2!n4!a4!n2!n8!c", 22, true, + [ + new PatternToken("BG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 8), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a4!n2!n8!c", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 8), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Bahrain + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BH + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BH2!n4!a14!c", 22, true, + [ + new PatternToken("BH"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'H' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a14!c", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 14), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Burundi + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BI2!n5!n5!n11!n2!n", 27, true, + [ + new PatternToken("BI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n5!n11!n2!n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Brazil + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BR2!n8!n5!n10!n1!a1!c", 29, true, + [ + new PatternToken("BR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8!n5!n10!n1!a1!c", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("8!n", 8, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Republic of Belarus + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("BY2!n4!c4!n16!c", 28, true, + [ + new PatternToken("BY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!c4!n16!c", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!c", 4, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + ] + ); + + } + + // Switzerland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CH + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("CH2!n5!n12!c", 21, true, + [ + new PatternToken("CH"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'H' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n12!c", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Costa Rica + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("CR2!n4!n14!n", 22, true, + [ + new PatternToken("CR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n14!n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Cyprus + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("CY2!n3!n5!n16!c", 28, true, + [ + new PatternToken("CY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n5!n16!c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Czechia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("CZ2!n4!n6!n10!n", 24, true, + [ + new PatternToken("CZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n6!n10!n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Germany + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("DE2!n8!n10!n", 22, true, + [ + new PatternToken("DE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8!n10!n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("8!n", 8, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + } + + // Djibouti + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DJ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("DJ2!n5!n5!n11!n2!n", 27, true, + [ + new PatternToken("DJ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'J' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n5!n11!n2!n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Denmark + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("DK2!n4!n9!n1!n", 18, true, + [ + new PatternToken("DK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n9!n1!n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Dominican Republic + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("DO2!n4!c20!n", 28, true, + [ + new PatternToken("DO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!c20!n", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!c", 4, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + ] + ); + + } + + // Estonia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class EE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("EE2!n2!n14!n", 20, true, + [ + new PatternToken("EE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!n14!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + } + + // Egypt + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class EG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("EG2!n4!n4!n17!n", 29, true, + [ + new PatternToken("EG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 17), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n4!n17!n", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 17), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Spain + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ES + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("ES2!n4!n4!n1!n1!n10!n", 24, true, + [ + new PatternToken("ES"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n4!n1!n1!n10!n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Finland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("FI2!n3!n11!n", 18, true, + [ + new PatternToken("FI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 11), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("6!n8!n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + internal static readonly Pattern Bank = new Pattern("6!n", 6, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + ] + ); + + } + + // Falkland Islands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("FK2!n2!a12!n", 18, true, + [ + new PatternToken("FK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!a12!n", 14, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!a", 2, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + ] + ); + + } + + // Faroe Islands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("FO2!n4!n9!n1!n", 18, true, + [ + new PatternToken("FO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n9!n1!n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // France + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("FR2!n5!n5!n11!c2!n", 27, true, + [ + new PatternToken("FR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n5!n11!c2!n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // United Kingdom + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GB + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GB2!n4!a6!n8!n", 22, true, + [ + new PatternToken("GB"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'B' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a6!n8!n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("6!n", 6, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + ] + ); + } + + // Georgia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GE2!n2!a16!n", 22, true, + [ + new PatternToken("GE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!a16!n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!a", 2, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + ] + ); + + } + + // Gibraltar + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GI2!n4!a15!c", 23, true, + [ + new PatternToken("GI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a15!c", 19, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 15), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Greenland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GL2!n4!n9!n1!n", 18, true, + [ + new PatternToken("GL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n9!n1!n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 9), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Greece + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GR2!n3!n4!n16!c", 27, true, + [ + new PatternToken("GR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n4!n16!c", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Guatemala + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("GT2!n4!c20!c", 28, true, + [ + new PatternToken("GT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!c20!c", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!c", 4, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + ] + ); + + } + + // Honduras + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("HN2!n4!a20!n", 28, true, + [ + new PatternToken("HN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a20!n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Croatia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("HR2!n7!n10!n", 21, true, + [ + new PatternToken("HR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("7!n10!n", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("7!n", 7, true, + [ + new PatternToken(AsciiCategory.Digit, 7), + ] + ); + + } + + // Hungary + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("HU2!n3!n4!n1!n15!n1!n", 28, true, + [ + new PatternToken("HU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 15), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n4!n1!n15!n1!n", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.Digit, 15), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Ireland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("IE2!n4!a6!n8!n", 22, true, + [ + new PatternToken("IE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a6!n8!n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("6!n", 6, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + ] + ); + } + + // Israel + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("IL2!n3!n3!n13!n", 23, true, + [ + new PatternToken("IL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n3!n13!n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Iraq + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IQ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("IQ2!n4!a3!n12!n", 23, true, + [ + new PatternToken("IQ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'Q' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a3!n12!n", 19, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Iceland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("IS2!n4!n2!n6!n10!n", 26, true, + [ + new PatternToken("IS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n2!n6!n10!n", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Branch = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + } + + // Italy + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("IT2!n1!a5!n5!n12!c", 27, true, + [ + new PatternToken("IT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("1!a5!n5!n12!c", 23, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Jordan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class JO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("JO2!n4!a4!n18!c", 30, true, + [ + new PatternToken("JO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'J' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a4!n18!c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Kuwait + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class KW + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("KW2!n4!a22!c", 30, true, + [ + new PatternToken("KW"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'K' + && value[pos++] == 'W' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a22!c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 22), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Kazakhstan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class KZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("KZ2!n3!n13!c", 20, true, + [ + new PatternToken("KZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'K' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n13!c", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Lebanon + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LB + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LB2!n4!n20!c", 28, true, + [ + new PatternToken("LB"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'B' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n20!c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Saint Lucia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LC2!n4!a24!c", 32, true, + [ + new PatternToken("LC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 24), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a24!c", 28, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 24), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Liechtenstein + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LI2!n5!n12!c", 21, true, + [ + new PatternToken("LI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n12!c", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Lithuania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LT2!n5!n11!n", 20, true, + [ + new PatternToken("LT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n11!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Luxembourg + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LU2!n3!n13!c", 20, true, + [ + new PatternToken("LU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n13!c", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Latvia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LV + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LV2!n4!a13!c", 21, true, + [ + new PatternToken("LV"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'V' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a13!c", 17, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Libya + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("LY2!n3!n3!n15!n", 25, true, + [ + new PatternToken("LY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n3!n15!n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Monaco + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MC2!n5!n5!n11!c2!n", 27, true, + [ + new PatternToken("MC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n5!n11!c2!n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Moldova + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MD2!n2!c18!c", 24, true, + [ + new PatternToken("MD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!c18!c", 20, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!c", 2, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + ] + ); + + } + + // Montenegro + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ME + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("ME2!n3!n13!n2!n", 22, true, + [ + new PatternToken("ME"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n13!n2!n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Macedonia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MK2!n3!n10!c2!n", 19, true, + [ + new PatternToken("MK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n10!c2!n", 15, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Mongolia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MN2!n4!n12!n", 20, true, + [ + new PatternToken("MN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n12!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Mauritania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MR2!n5!n5!n11!n2!n", 27, true, + [ + new PatternToken("MR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n5!n11!n2!n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Malta + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MT2!n4!a5!n18!c", 31, true, + [ + new PatternToken("MT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a5!n18!c", 27, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Mauritius + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("MU2!n4!a2!n2!n12!n3!n3!a", 30, true, + [ + new PatternToken("MU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 12), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a2!n2!n12!n3!n3!a", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 12), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ); + + internal static readonly Pattern Bank = new Pattern("6!c", 6, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 6), + ] + ); + + internal static readonly Pattern Branch = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + } + + // Nicaragua + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("NI2!n4!a20!n", 28, true, + [ + new PatternToken("NI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a20!n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Netherlands (The) + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("NL2!n4!a10!n", 18, true, + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a10!n", 14, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Norway + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("NO2!n4!n6!n1!n", 15, true, + [ + new PatternToken("NO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n6!n1!n", 11, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // Oman + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class OM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("OM2!n3!n16!c", 23, true, + [ + new PatternToken("OM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'O' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n16!c", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Pakistan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("PK2!n4!a16!c", 24, true, + [ + new PatternToken("PK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a16!c", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Poland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("PL2!n8!n16!n", 28, true, + [ + new PatternToken("PL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8!n16!n", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + internal static readonly Pattern Branch = new Pattern("8!n", 8, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + } + + // Palestine, State of + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("PS2!n4!a21!c", 29, true, + [ + new PatternToken("PS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a21!c", 25, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Portugal + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("PT2!n4!n4!n11!n2!n", 25, true, + [ + new PatternToken("PT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n4!n11!n2!n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // Qatar + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class QA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("QA2!n4!a21!c", 29, true, + [ + new PatternToken("QA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'Q' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a21!c", 25, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Romania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class RO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("RO2!n4!a16!c", 24, true, + [ + new PatternToken("RO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'R' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a16!c", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Serbia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class RS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("RS2!n3!n13!n2!n", 22, true, + [ + new PatternToken("RS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'R' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n13!n2!n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Saudi Arabia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SA2!n2!n18!c", 24, true, + [ + new PatternToken("SA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!n18!c", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + } + + // Seychelles + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SC2!n4!a2!n2!n16!n3!a", 31, true, + [ + new PatternToken("SC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a2!n2!n16!n3!a", 27, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a2!n", 6, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Branch = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + } + + // Sudan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SD2!n2!n12!n", 18, true, + [ + new PatternToken("SD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!n12!n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + } + + // Sweden + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SE2!n3!n16!n1!n", 24, true, + [ + new PatternToken("SE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + new PatternToken(AsciiCategory.Digit, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n16!n1!n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + new PatternToken(AsciiCategory.Digit, 1), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Slovenia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SI2!n5!n8!n2!n", 19, true, + [ + new PatternToken("SI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n8!n2!n", 15, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Slovakia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SK2!n4!n6!n10!n", 24, true, + [ + new PatternToken("SK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n6!n10!n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + } + + // San Marino + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SM2!n1!a5!n5!n12!c", 27, true, + [ + new PatternToken("SM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("1!a5!n5!n12!c", 23, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + internal static readonly Pattern Branch = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + } + + // Somalia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SO2!n4!n3!n12!n", 23, true, + [ + new PatternToken("SO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n3!n12!n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Sao Tome and Principe + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ST + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("ST2!n8!n11!n2!n", 25, true, + [ + new PatternToken("ST"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8!n11!n2!n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + + // El Salvador + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SV + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("SV2!n4!a20!n", 28, true, + [ + new PatternToken("SV"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'V' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a20!n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Timor-Leste + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("TL2!n3!n14!n2!n", 23, true, + [ + new PatternToken("TL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 14), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n14!n2!n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 14), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Tunisia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("TN2!n2!n3!n13!n2!n", 24, true, + [ + new PatternToken("TN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2!n3!n13!n2!n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 13), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Branch = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + } + + // Turkey + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("TR2!n5!n1!n16!c", 26, true, + [ + new PatternToken("TR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5!n1!n16!c", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("5!n", 5, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + ] + ); + + } + + // Ukraine + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class UA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("UA2!n6!n19!c", 29, true, + [ + new PatternToken("UA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 19), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'U' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("6!n19!c", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 19), + ] + ); + + internal static readonly Pattern Bank = new Pattern("6!n", 6, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + ] + ); + + } + + // Vatican City State + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class VA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("VA2!n3!n15!n", 22, true, + [ + new PatternToken("VA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'V' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3!n15!n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ); + + internal static readonly Pattern Bank = new Pattern("3!n", 3, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + ] + ); + + } + + // Virgin Islands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class VG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("VG2!n4!a16!n", 24, true, + [ + new PatternToken("VG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'V' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a16!n", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + } + + // Kosovo + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class XK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("XK2!n4!n10!n2!n", 20, true, + [ + new PatternToken("XK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'X' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!n10!n2!n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Bank = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + internal static readonly Pattern Branch = new Pattern("2!n", 2, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + } + + // Yemen + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class YE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("YE2!n4!a4!n18!c", 30, true, + [ + new PatternToken("YE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'Y' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4!a4!n18!c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + internal static readonly Pattern Bank = new Pattern("4!a", 4, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + ] + ); + + internal static readonly Pattern Branch = new Pattern("4!n", 4, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + ] + ); + } + } +} diff --git a/src/IbanNet/IbanNet.csproj b/src/IbanNet/IbanNet.csproj index 2aa603ea..6dd180e0 100644 --- a/src/IbanNet/IbanNet.csproj +++ b/src/IbanNet/IbanNet.csproj @@ -29,12 +29,20 @@ + + true + Generated + + + + + + + + + + - - True - True - SwiftRegistryProvider.tt - True True @@ -67,10 +75,6 @@ - - TextTemplatingFileGenerator - SwiftRegistryProvider.cs - TextTemplatingFileGenerator WikipediaRegistryProvider.cs diff --git a/src/IbanNet/Registry/Patterns/Pattern.cs b/src/IbanNet/Registry/Patterns/Pattern.cs index f7a462a8..5249afaf 100644 --- a/src/IbanNet/Registry/Patterns/Pattern.cs +++ b/src/IbanNet/Registry/Patterns/Pattern.cs @@ -48,6 +48,19 @@ protected Pattern(IEnumerable tokens) _tokens = tokens as IReadOnlyList ?? tokens.ToArray(); } + private protected Pattern(string pattern, int maxLength, bool isFixedLength, PatternToken[] tokens) + { + if (maxLength <= 0) + { + throw new ArgumentOutOfRangeException(nameof(maxLength)); + } + + _pattern = pattern ?? throw new ArgumentNullException(nameof(pattern)); + _maxLength = maxLength; + _fixedLength = isFixedLength; + _tokens = tokens ?? throw new ArgumentNullException(nameof(tokens)); + } + /// /// Gets the individual tokens describing the pattern. /// diff --git a/src/IbanNet/Registry/Patterns/PatternToken.cs b/src/IbanNet/Registry/Patterns/PatternToken.cs index 273e5b02..5ce32b56 100644 --- a/src/IbanNet/Registry/Patterns/PatternToken.cs +++ b/src/IbanNet/Registry/Patterns/PatternToken.cs @@ -63,6 +63,7 @@ private PatternToken(AsciiCategory category, int minLength, int maxLength, strin throw new InvalidEnumArgumentException(nameof(category), (int)category, typeof(AsciiCategory)); } +#pragma warning disable RS1035 if (minLength <= 0) { throw new ArgumentOutOfRangeException(minLengthPropertyName, string.Format(CultureInfo.CurrentCulture, Resources.The_value_cannot_be_less_than_or_equal_to_0, 0)); @@ -83,6 +84,7 @@ private PatternToken(AsciiCategory category, int minLength, int maxLength, strin MaxLength = maxLength; IsFixedLength = minLength == MaxLength; } +#pragma warning restore RS1035 /// /// Gets the ASCII category for this token. diff --git a/src/IbanNet/Registry/Patterns/PatternTokenizer.cs b/src/IbanNet/Registry/Patterns/PatternTokenizer.cs index 600b55c7..2ffedc3f 100644 --- a/src/IbanNet/Registry/Patterns/PatternTokenizer.cs +++ b/src/IbanNet/Registry/Patterns/PatternTokenizer.cs @@ -95,7 +95,9 @@ private PatternToken CreateToken(string token, int pos) if (asciiCategory == AsciiCategory.None || occurrences <= 0) { +#pragma warning disable RS1035 throw new PatternException(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos)); +#pragma warning restore RS1035 } return new PatternToken(asciiCategory, isFixedLength ? occurrences : 1, occurrences); @@ -107,7 +109,9 @@ or FormatException and not PatternException or IndexOutOfRangeException ) { +#pragma warning disable RS1035 throw new PatternException(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos), ex); +#pragma warning restore RS1035 } } diff --git a/src/IbanNet/Registry/Swift/SwiftRegistryProvider.cs b/src/IbanNet/Registry/Swift/SwiftRegistryProvider.cs index a66bf4e5..88dabdd5 100644 --- a/src/IbanNet/Registry/Swift/SwiftRegistryProvider.cs +++ b/src/IbanNet/Registry/Swift/SwiftRegistryProvider.cs @@ -1,29 +1,21 @@ -using System.CodeDom.Compiler; -using System.Collections; +using System.Collections; using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using IbanNet.Extensions; +using IbanNet.CodeGen; namespace IbanNet.Registry.Swift; /// /// This IBAN registry provider contains IBAN/BBAN/SEPA information for all known IBAN countries. /// -/// -/// Generated from: swift_iban_registry_202412.r99.txt -/// -[GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] -public class SwiftRegistryProvider : IIbanRegistryProvider +public partial class SwiftRegistryProvider : IIbanRegistryProvider { [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private ICollection? _countries; + private readonly Lazy> _countries = new(() => Load().ToList()); /// public IEnumerator GetEnumerator() { - _countries = _countries ??= Load().ToList(); - - return _countries.GetEnumerator(); + return _countries.Value.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() @@ -32,6522 +24,8 @@ IEnumerator IEnumerable.GetEnumerator() } /// - // ReSharper disable once UseCollectionCountProperty - justification: need to init _countries first. - public int Count => _countries?.Count ?? this.Count(); - - private static IEnumerable Load() - { - // ReSharper disable CommentTypo - // ReSharper disable StringLiteralTypo - - // Andorra - yield return new IbanCountry("AD") - { - NativeName = "Andorra", - EnglishName = "Andorra", - Iban = new PatternDescriptor(new Patterns.AD()) - { - Example = "AD1200012030200359100100" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n4!n12!c"), 4) - { - Example = "00012030200359100100" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0001" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "2030" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "2030200359100100", - LastUpdatedDate = new DateTimeOffset(2021, 3, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // United Arab Emirates (The) - yield return new IbanCountry("AE") - { - NativeName = "الإمارات العربية المتحدة", - EnglishName = "United Arab Emirates (The)", - Iban = new PatternDescriptor(new Patterns.AE()) - { - Example = "AE070331234567890123456" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n16!n"), 4) - { - Example = "0331234567890123456" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "033" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "1234567890123456", - LastUpdatedDate = new DateTimeOffset(2015, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2011, 10, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Albania - yield return new IbanCountry("AL") - { - NativeName = "Shqipëri", - EnglishName = "Albania", - Iban = new PatternDescriptor(new Patterns.AL()) - { - Example = "AL47212110090000000235698741" - }, - Bban = new PatternDescriptor(new SwiftPattern("8!n16!c"), 4) - { - Example = "212110090000000235698741" - }, - Bank = new PatternDescriptor(new SwiftPattern("8!n"), 4) - { - Example = "21211009" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 7) - { - Example = "1100" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0000000235698741", - LastUpdatedDate = new DateTimeOffset(2011, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2009, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Austria - yield return new IbanCountry("AT") - { - NativeName = "Österreich", - EnglishName = "Austria", - Iban = new PatternDescriptor(new Patterns.AT()) - { - Example = "AT611904300234573201" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n11!n"), 4) - { - Example = "1904300234573201" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "19043" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "BLZ 19043 Kto 234573201", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Azerbaijan - yield return new IbanCountry("AZ") - { - NativeName = "Азәрбајҹан", - EnglishName = "Azerbaijan", - Iban = new PatternDescriptor(new Patterns.AZ()) - { - Example = "AZ21NABZ00000000137010001944" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a20!c"), 4) - { - Example = "NABZ00000000137010001944" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "NABZ" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "NABZ00000000137010001944", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2013, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Bosnia and Herzegovina - yield return new IbanCountry("BA") - { - NativeName = "Bosna i Hercegovina", - EnglishName = "Bosnia and Herzegovina", - Iban = new PatternDescriptor(new Patterns.BA()) - { - Example = "BA391290079401028494" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n3!n8!n2!n"), 4) - { - Example = "1990440001200279" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "199" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 7) - { - Example = "044" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "199-044-00012002-79", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Belgium - yield return new IbanCountry("BE") - { - NativeName = "België", - EnglishName = "Belgium", - Iban = new PatternDescriptor(new Patterns.BE()) - { - Example = "BE68539007547034" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n7!n2!n"), 4) - { - Example = "539007547034" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "539" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "BE68 5390 0754 7034", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Bulgaria - yield return new IbanCountry("BG") - { - NativeName = "България", - EnglishName = "Bulgaria", - Iban = new PatternDescriptor(new Patterns.BG()) - { - Example = "BG80BNBG96611020345678" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a4!n2!n8!c"), 4) - { - Example = "BNBG96611020345678" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "BNBG" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "9661" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Bahrain - yield return new IbanCountry("BH") - { - NativeName = "البحرين", - EnglishName = "Bahrain", - Iban = new PatternDescriptor(new Patterns.BH()) - { - Example = "BH67BMAG00001299123456" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a14!c"), 4) - { - Example = "BMAG00001299123456" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "BMAG" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00001299123456", - LastUpdatedDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Burundi - yield return new IbanCountry("BI") - { - NativeName = "Burundi", - EnglishName = "Burundi", - Iban = new PatternDescriptor(new Patterns.BI()) - { - Example = "BI4210000100010000332045181" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n5!n11!n2!n"), 4) - { - Example = "10000100010000332045181" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "10000" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 9) - { - Example = "10001" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00003320451 81", - LastUpdatedDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Brazil - yield return new IbanCountry("BR") - { - NativeName = "Brasil", - EnglishName = "Brazil", - Iban = new PatternDescriptor(new Patterns.BR()) - { - Example = "BR1800360305000010009795493C1" - }, - Bban = new PatternDescriptor(new SwiftPattern("8!n5!n10!n1!a1!c"), 4) - { - Example = "00360305000010009795493P1" - }, - Bank = new PatternDescriptor(new SwiftPattern("8!n"), 4) - { - Example = "00360305" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 12) - { - Example = "00001" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0009795493C1", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2013, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Republic of Belarus - yield return new IbanCountry("BY") - { - NativeName = "Беларусь", - EnglishName = "Republic of Belarus", - Iban = new PatternDescriptor(new Patterns.BY()) - { - Example = "BY13NBRB3600900000002Z00AB00" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!c4!n16!c"), 4) - { - Example = "NBRB3600900000002Z00AB00" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!c"), 4) - { - Example = "NBRB" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "3600 0000 0000 0Z00 AB00", - LastUpdatedDate = new DateTimeOffset(2024, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2017, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Switzerland - yield return new IbanCountry("CH") - { - NativeName = "Svizzera", - EnglishName = "Switzerland", - Iban = new PatternDescriptor(new Patterns.CH()) - { - Example = "CH9300762011623852957" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n12!c"), 4) - { - Example = "00762011623852957" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "00762" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "762 1162-3852.957", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Costa Rica - yield return new IbanCountry("CR") - { - NativeName = "Costa Rica", - EnglishName = "Costa Rica", - Iban = new PatternDescriptor(new Patterns.CR()) - { - Example = "CR05015202001026284066" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n14!n"), 4) - { - Example = "15202001026284066" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0152" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "02001026284066", - LastUpdatedDate = new DateTimeOffset(2019, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2011, 6, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Cyprus - yield return new IbanCountry("CY") - { - NativeName = "Κύπρος", - EnglishName = "Cyprus", - Iban = new PatternDescriptor(new Patterns.CY()) - { - Example = "CY17002001280000001200527600" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n5!n16!c"), 4) - { - Example = "002001280000001200527600" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "002" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 7) - { - Example = "00128" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "0000001200527600", - LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Czechia - yield return new IbanCountry("CZ") - { - NativeName = "Česko", - EnglishName = "Czechia", - Iban = new PatternDescriptor(new Patterns.CZ()) - { - Example = "CZ6508000000192000145399" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n6!n10!n"), 4) - { - Example = "08000000192000145399" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0800" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "19-2000145399/0800", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Germany - yield return new IbanCountry("DE") - { - NativeName = "Deutschland", - EnglishName = "Germany", - Iban = new PatternDescriptor(new Patterns.DE()) - { - Example = "DE89370400440532013000" - }, - Bban = new PatternDescriptor(new SwiftPattern("8!n10!n"), 4) - { - Example = "370400440532013000" - }, - Bank = new PatternDescriptor(new SwiftPattern("8!n"), 4) - { - Example = "37040044" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "532013000", - LastUpdatedDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Djibouti - yield return new IbanCountry("DJ") - { - NativeName = "Yabuuti", - EnglishName = "Djibouti", - Iban = new PatternDescriptor(new Patterns.DJ()) - { - Example = "DJ2100010000000154000100186" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n5!n11!n2!n"), 4) - { - Example = "00010000000154000100186" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "00010" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 9) - { - Example = "00000" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0154000100186", - LastUpdatedDate = new DateTimeOffset(2022, 5, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2022, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Denmark - yield return new IbanCountry("DK") - { - NativeName = "Danmark", - EnglishName = "Denmark", - Iban = new PatternDescriptor(new Patterns.DK()) - { - Example = "DK5000400440116243" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n9!n1!n"), 4) - { - Example = "00400440116243" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0040" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "0040 0440116243", - LastUpdatedDate = new DateTimeOffset(2018, 11, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Dominican Republic - yield return new IbanCountry("DO") - { - NativeName = "República Dominicana", - EnglishName = "Dominican Republic", - Iban = new PatternDescriptor(new Patterns.DO()) - { - Example = "DO28BAGR00000001212453611324" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!c20!n"), 4) - { - Example = "BAGR00000001212453611324" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!c"), 4) - { - Example = "BAGR" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00000001212453611324", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2010, 12, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Estonia - yield return new IbanCountry("EE") - { - NativeName = "Eesti", - EnglishName = "Estonia", - Iban = new PatternDescriptor(new Patterns.EE()) - { - Example = "EE382200221020145685" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!n14!n"), 4) - { - Example = "2200221020145685" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "22" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "221020145685", - LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Egypt - yield return new IbanCountry("EG") - { - NativeName = "مصر", - EnglishName = "Egypt", - Iban = new PatternDescriptor(new Patterns.EG()) - { - Example = "EG380019000500000000263180002" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n4!n17!n"), 4) - { - Example = "0019000500000000263180002" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0019" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "0005" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "000263180002", - LastUpdatedDate = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2021, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Spain - yield return new IbanCountry("ES") - { - NativeName = "España", - EnglishName = "Spain", - Iban = new PatternDescriptor(new Patterns.ES()) - { - Example = "ES9121000418450200051332" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n4!n1!n1!n10!n"), 4) - { - Example = "21000418450200051332" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "2100" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "0418" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "2100 0418 45 0200051332", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Finland - yield return new IbanCountry("FI") - { - NativeName = "Suomi", - EnglishName = "Finland", - IncludedCountries = - [ - "AX" - ], - Iban = new PatternDescriptor(new Patterns.FI()) - { - Example = "FI2112345600000785" - }, - Bban = new PatternDescriptor(new SwiftPattern("6!n8!n"), 4) - { - Example = "12345600000785" - }, - Bank = new PatternDescriptor(new SwiftPattern("6!n"), 4) - { - Example = "123456" - }, - Sepa = new SepaInfo - { - IsMember = true, - IncludedCountries = - [ - "AX" - ] - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2011, 12, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Falkland Islands - yield return new IbanCountry("FK") - { - NativeName = "Falkland Islands", - EnglishName = "Falkland Islands", - Iban = new PatternDescriptor(new Patterns.FK()) - { - Example = "FK88SC123456789012" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!a12!n"), 4) - { - Example = "SC123456789012" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!a"), 4) - { - Example = "SC" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "123456789012", - LastUpdatedDate = new DateTimeOffset(2023, 7, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2023, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Faroe Islands - yield return new IbanCountry("FO") - { - NativeName = "Føroyar", - EnglishName = "Faroe Islands", - Iban = new PatternDescriptor(new Patterns.FO()) - { - Example = "FO6264600001631634" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n9!n1!n"), 4) - { - Example = "64600001631634" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "6460" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "6460 0001631634", - LastUpdatedDate = new DateTimeOffset(2017, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // France - yield return new IbanCountry("FR") - { - NativeName = "France", - EnglishName = "France", - IncludedCountries = - [ - "GF", "GP", "MQ", "RE", "PF", "TF", "YT", "NC", "BL", "MF", "PM", "WF" - ], - Iban = new PatternDescriptor(new Patterns.FR()) - { - Example = "FR1420041010050500013M02606" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n5!n11!c2!n"), 4) - { - Example = "20041010050500013M02606" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "20041" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 9) - { - Example = "01005" - }, - Sepa = new SepaInfo - { - IsMember = true, - IncludedCountries = - [ - "GF", "GP", "MQ", "YT", "RE", "PM", "BL", "MF" - ] - }, - DomesticAccountNumberExample = "20041 01005 0500013M026 06", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // United Kingdom - yield return new IbanCountry("GB") - { - NativeName = "United Kingdom", - EnglishName = "United Kingdom", - IncludedCountries = - [ - "IM", "JE", "GG" - ], - Iban = new PatternDescriptor(new Patterns.GB()) - { - Example = "GB29NWBK60161331926819" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a6!n8!n"), 4) - { - Example = "NWBK60161331926819" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "NWBK" - }, - Branch = new PatternDescriptor(new SwiftPattern("6!n"), 8) - { - Example = "601613" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "60-16-13 31926819", - LastUpdatedDate = new DateTimeOffset(2017, 5, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Georgia - yield return new IbanCountry("GE") - { - NativeName = "საქართველო", - EnglishName = "Georgia", - Iban = new PatternDescriptor(new Patterns.GE()) - { - Example = "GE29NB0000000101904917" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!a16!n"), 4) - { - Example = "NB0000000101904917" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!a"), 4) - { - Example = "NB" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0000000101904917", - LastUpdatedDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2010, 5, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Gibraltar - yield return new IbanCountry("GI") - { - NativeName = "Gibraltar", - EnglishName = "Gibraltar", - Iban = new PatternDescriptor(new Patterns.GI()) - { - Example = "GI75NWBK000000007099453" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a15!c"), 4) - { - Example = "NWBK000000007099453" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "NWBK" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "0000 00007099 453", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Greenland - yield return new IbanCountry("GL") - { - NativeName = "Kalaallit Nunaat", - EnglishName = "Greenland", - Iban = new PatternDescriptor(new Patterns.GL()) - { - Example = "GL8964710001000206" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n9!n1!n"), 4) - { - Example = "64710001000206" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "6471" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "6471 0001000206", - LastUpdatedDate = new DateTimeOffset(2017, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Greece - yield return new IbanCountry("GR") - { - NativeName = "Ελλάδα", - EnglishName = "Greece", - Iban = new PatternDescriptor(new Patterns.GR()) - { - Example = "GR1601101250000000012300695" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n4!n16!c"), 4) - { - Example = "01101250000000012300695" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "011" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 7) - { - Example = "0125" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "01250000000012300695", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Guatemala - yield return new IbanCountry("GT") - { - NativeName = "Guatemala", - EnglishName = "Guatemala", - Iban = new PatternDescriptor(new Patterns.GT()) - { - Example = "GT82TRAJ01020000001210029690" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!c20!c"), 4) - { - Example = "TRAJ01020000001210029690" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!c"), 4) - { - Example = "TRAJ" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "01020000001210029690", - LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Honduras - yield return new IbanCountry("HN") - { - NativeName = "Honduras", - EnglishName = "Honduras", - Iban = new PatternDescriptor(new Patterns.HN()) - { - Example = "HN88CABF00000000000250005469" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a20!n"), 4) - { - Example = "CABF00000000000250005469" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "CABF" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "250005469", - LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2024, 10, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Croatia - yield return new IbanCountry("HR") - { - NativeName = "Hrvatska", - EnglishName = "Croatia", - Iban = new PatternDescriptor(new Patterns.HR()) - { - Example = "HR1210010051863000160" - }, - Bban = new PatternDescriptor(new SwiftPattern("7!n10!n"), 4) - { - Example = "10010051863000160" - }, - Bank = new PatternDescriptor(new SwiftPattern("7!n"), 4) - { - Example = "1001005" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "1001005-1863000160", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Hungary - yield return new IbanCountry("HU") - { - NativeName = "Magyarország", - EnglishName = "Hungary", - Iban = new PatternDescriptor(new Patterns.HU()) - { - Example = "HU42117730161111101800000000" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n4!n1!n15!n1!n"), 4) - { - Example = "117730161111101800000000" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "117" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 7) - { - Example = "7301" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "11773016-11111018-00000000", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Ireland - yield return new IbanCountry("IE") - { - NativeName = "Ireland", - EnglishName = "Ireland", - Iban = new PatternDescriptor(new Patterns.IE()) - { - Example = "IE29AIBK93115212345678" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a6!n8!n"), 4) - { - Example = "AIBK93115212345678" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "AIBK" - }, - Branch = new PatternDescriptor(new SwiftPattern("6!n"), 8) - { - Example = "931152" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "93-11-52 12345678", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Israel - yield return new IbanCountry("IL") - { - NativeName = "ישראל", - EnglishName = "Israel", - Iban = new PatternDescriptor(new Patterns.IL()) - { - Example = "IL620108000000099999999" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n3!n13!n"), 4) - { - Example = "010800000099999999" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "010" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 7) - { - Example = "800" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "10-800-99999999", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Iraq - yield return new IbanCountry("IQ") - { - NativeName = "العراق", - EnglishName = "Iraq", - Iban = new PatternDescriptor(new Patterns.IQ()) - { - Example = "IQ98NBIQ850123456789012" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a3!n12!n"), 4) - { - Example = "NBIQ850123456789012" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "NBIQ" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 8) - { - Example = "850" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "123456789012", - LastUpdatedDate = new DateTimeOffset(2016, 11, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2017, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Iceland - yield return new IbanCountry("IS") - { - NativeName = "Ísland", - EnglishName = "Iceland", - Iban = new PatternDescriptor(new Patterns.IS()) - { - Example = "IS140159260076545510730339" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n2!n6!n10!n"), 4) - { - Example = "0159260076545510730339" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "01" - }, - Branch = new PatternDescriptor(new SwiftPattern("2!n"), 6) - { - Example = "59" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "0159-26-007654-551073-0339", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Italy - yield return new IbanCountry("IT") - { - NativeName = "Italia", - EnglishName = "Italy", - Iban = new PatternDescriptor(new Patterns.IT()) - { - Example = "IT60X0542811101000000123456" - }, - Bban = new PatternDescriptor(new SwiftPattern("1!a5!n5!n12!c"), 4) - { - Example = "X0542811101000000123456" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 5) - { - Example = "05428" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 10) - { - Example = "11101" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "X 05428 11101 000000123456", - LastUpdatedDate = new DateTimeOffset(2013, 3, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Jordan - yield return new IbanCountry("JO") - { - NativeName = "الأردن", - EnglishName = "Jordan", - Iban = new PatternDescriptor(new Patterns.JO()) - { - Example = "JO94CBJO0010000000000131000302" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a4!n18!c"), 4) - { - Example = "CBJO0010000000000131000302" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "CBJO" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0001310000302", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2014, 2, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Kuwait - yield return new IbanCountry("KW") - { - NativeName = "الكويت", - EnglishName = "Kuwait", - Iban = new PatternDescriptor(new Patterns.KW()) - { - Example = "KW81CBKU0000000000001234560101" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a22!c"), 4) - { - Example = "CBKU0000000000001234560101" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "CBKU" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "1234560101", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Kazakhstan - yield return new IbanCountry("KZ") - { - NativeName = "Қазақстан", - EnglishName = "Kazakhstan", - Iban = new PatternDescriptor(new Patterns.KZ()) - { - Example = "KZ86125KZT5004100100" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n13!c"), 4) - { - Example = "125KZT5004100100" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "125" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "KZ86 125K ZT50 0410 0100", - LastUpdatedDate = new DateTimeOffset(2016, 3, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2010, 9, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Lebanon - yield return new IbanCountry("LB") - { - NativeName = "لبنان", - EnglishName = "Lebanon", - Iban = new PatternDescriptor(new Patterns.LB()) - { - Example = "LB62099900000001001901229114" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n20!c"), 4) - { - Example = "099900000001001901229114" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "0999" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "01 001 901229114", - LastUpdatedDate = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Saint Lucia - yield return new IbanCountry("LC") - { - NativeName = "St. Lucia", - EnglishName = "Saint Lucia", - Iban = new PatternDescriptor(new Patterns.LC()) - { - Example = "LC55HEMM000100010012001200023015" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a24!c"), 4) - { - Example = "HEMM000100010012001200023015" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "HEMM" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0001 0001 0012 0012 0002 3015", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Liechtenstein - yield return new IbanCountry("LI") - { - NativeName = "Liechtenstein", - EnglishName = "Liechtenstein", - Iban = new PatternDescriptor(new Patterns.LI()) - { - Example = "LI21088100002324013AA" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n12!c"), 4) - { - Example = "088100002324013AA" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "08810" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "8810 2324013AA", - LastUpdatedDate = new DateTimeOffset(2012, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Lithuania - yield return new IbanCountry("LT") - { - NativeName = "Lietuva", - EnglishName = "Lithuania", - Iban = new PatternDescriptor(new Patterns.LT()) - { - Example = "LT121000011101001000" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n11!n"), 4) - { - Example = "1000011101001000" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "10000" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Luxembourg - yield return new IbanCountry("LU") - { - NativeName = "Lëtzebuerg", - EnglishName = "Luxembourg", - Iban = new PatternDescriptor(new Patterns.LU()) - { - Example = "LU280019400644750000" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n13!c"), 4) - { - Example = "0019400644750000" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "001" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Latvia - yield return new IbanCountry("LV") - { - NativeName = "Latvija", - EnglishName = "Latvia", - Iban = new PatternDescriptor(new Patterns.LV()) - { - Example = "LV80BANK0000435195001" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a13!c"), 4) - { - Example = "BANK0000435195001" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "BANK" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "LV80 BANK 0000 4351 9500 1", - LastUpdatedDate = new DateTimeOffset(2009, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Libya - yield return new IbanCountry("LY") - { - NativeName = "ليبيا", - EnglishName = "Libya", - Iban = new PatternDescriptor(new Patterns.LY()) - { - Example = "LY83002048000020100120361" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n3!n15!n"), 4) - { - Example = "002048000020100120361" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "002" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 7) - { - Example = "048" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "000020100120361", - LastUpdatedDate = new DateTimeOffset(2020, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2021, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Monaco - yield return new IbanCountry("MC") - { - NativeName = "Monaco", - EnglishName = "Monaco", - Iban = new PatternDescriptor(new Patterns.MC()) - { - Example = "MC5811222000010123456789030" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n5!n11!c2!n"), 4) - { - Example = "11222000010123456789030" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "11222" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 9) - { - Example = "00001" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "0011111000h", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2008, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Moldova - yield return new IbanCountry("MD") - { - NativeName = "Republica Moldova", - EnglishName = "Moldova", - Iban = new PatternDescriptor(new Patterns.MD()) - { - Example = "MD24AG000225100013104168" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!c18!c"), 4) - { - Example = "AG000225100013104168" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!c"), 4) - { - Example = "AG" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "000225100013104168", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Montenegro - yield return new IbanCountry("ME") - { - NativeName = "Crna Gora", - EnglishName = "Montenegro", - Iban = new PatternDescriptor(new Patterns.ME()) - { - Example = "ME25505000012345678951" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n13!n2!n"), 4) - { - Example = "505000012345678951" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "505" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "505 0000123456789 51", - LastUpdatedDate = new DateTimeOffset(2010, 5, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Macedonia - yield return new IbanCountry("MK") - { - NativeName = "Северна Македонија", - EnglishName = "Macedonia", - Iban = new PatternDescriptor(new Patterns.MK()) - { - Example = "MK07250120000058984" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n10!c2!n"), 4) - { - Example = "250120000058984" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "300" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "MK07 300 0000000424 25", - LastUpdatedDate = new DateTimeOffset(2011, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Mongolia - yield return new IbanCountry("MN") - { - NativeName = "Монгол", - EnglishName = "Mongolia", - Iban = new PatternDescriptor(new Patterns.MN()) - { - Example = "MN121234123456789123" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n12!n"), 4) - { - Example = "1234123456789123" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "1234" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "1234 5678 9123", - LastUpdatedDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Mauritania - yield return new IbanCountry("MR") - { - NativeName = "موريتانيا", - EnglishName = "Mauritania", - Iban = new PatternDescriptor(new Patterns.MR()) - { - Example = "MR1300020001010000123456753" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n5!n11!n2!n"), 4) - { - Example = "00020001010000123456753" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "00020" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 9) - { - Example = "00101" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00020 00101 00001234567 53", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2012, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Malta - yield return new IbanCountry("MT") - { - NativeName = "Malta", - EnglishName = "Malta", - Iban = new PatternDescriptor(new Patterns.MT()) - { - Example = "MT84MALT011000012345MTLCAST001S" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a5!n18!c"), 4) - { - Example = "MALT011000012345MTLCAST001S" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "MALT" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 8) - { - Example = "01100" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "12345MTLCAST001S", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Mauritius - yield return new IbanCountry("MU") - { - NativeName = "Mauritius", - EnglishName = "Mauritius", - Iban = new PatternDescriptor(new Patterns.MU()) - { - Example = "MU17BOMM0101101030300200000MUR" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a2!n2!n12!n3!n3!a"), 4) - { - Example = "BOMM0101101030300200000MUR" - }, - Bank = new PatternDescriptor(new SwiftPattern("6!c"), 4) - { - Example = "BOMM01" - }, - Branch = new PatternDescriptor(new SwiftPattern("2!n"), 10) - { - Example = "01" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "MU17 BOMM 0101 1010 3030 0200 000M UR", - LastUpdatedDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Nicaragua - yield return new IbanCountry("NI") - { - NativeName = "Nicaragua", - EnglishName = "Nicaragua", - Iban = new PatternDescriptor(new Patterns.NI()) - { - Example = "NI45BAPR00000013000003558124" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a20!n"), 4) - { - Example = "BAPR00000013000003558124" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "BAPR" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00000013000003558124", - LastUpdatedDate = new DateTimeOffset(2024, 12, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2023, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Netherlands (The) - yield return new IbanCountry("NL") - { - NativeName = "Nederland", - EnglishName = "Netherlands (The)", - Iban = new PatternDescriptor(new Patterns.NL()) - { - Example = "NL91ABNA0417164300" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a10!n"), 4) - { - Example = "ABNA0417164300" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "ABNA" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "041 71 64 300", - LastUpdatedDate = new DateTimeOffset(2020, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Norway - yield return new IbanCountry("NO") - { - NativeName = "Noreg", - EnglishName = "Norway", - Iban = new PatternDescriptor(new Patterns.NO()) - { - Example = "NO9386011117947" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n6!n1!n"), 4) - { - Example = "86011117947" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "8601" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "8601 11 17947", - LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Oman - yield return new IbanCountry("OM") - { - NativeName = "عمان", - EnglishName = "Oman", - Iban = new PatternDescriptor(new Patterns.OM()) - { - Example = "OM810180000001299123456" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n16!c"), 4) - { - Example = "0180000001299123456" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "018" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0000001299123456", - LastUpdatedDate = new DateTimeOffset(2024, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2024, 3, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Pakistan - yield return new IbanCountry("PK") - { - NativeName = "پاکستان", - EnglishName = "Pakistan", - Iban = new PatternDescriptor(new Patterns.PK()) - { - Example = "PK36SCBL0000001123456702" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a16!c"), 4) - { - Example = "SCBL0000001123456702" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "SCBL" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00260101036360", - LastUpdatedDate = new DateTimeOffset(2012, 12, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2012, 12, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Poland - yield return new IbanCountry("PL") - { - NativeName = "Polska", - EnglishName = "Poland", - Iban = new PatternDescriptor(new Patterns.PL()) - { - Example = "PL61109010140000071219812874" - }, - Bban = new PatternDescriptor(new SwiftPattern("8!n16!n"), 4) - { - Example = "109010140000071219812874" - }, - Branch = new PatternDescriptor(new SwiftPattern("8!n"), 4) - { - Example = "10901014" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "61 1090 1014 0000 0712 1981 2874", - LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Palestine, State of - yield return new IbanCountry("PS") - { - NativeName = "السلطة الفلسطينية", - EnglishName = "Palestine, State of", - Iban = new PatternDescriptor(new Patterns.PS()) - { - Example = "PS92PALS000000000400123456702" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a21!c"), 4) - { - Example = "PALS000000000400123456702" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "PALS" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "400123456702", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2012, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Portugal - yield return new IbanCountry("PT") - { - NativeName = "Portugal", - EnglishName = "Portugal", - Iban = new PatternDescriptor(new Patterns.PT()) - { - Example = "PT50000201231234567890154" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n4!n11!n2!n"), 4) - { - Example = "000201231234567890154" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0002" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "0123" - }, - Sepa = new SepaInfo - { - IsMember = true, - IncludedCountries = - [ - "AZ", "MA" - ] - }, - DomesticAccountNumberExample = "0002.0123.12345678901.54", - LastUpdatedDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Qatar - yield return new IbanCountry("QA") - { - NativeName = "قطر", - EnglishName = "Qatar", - Iban = new PatternDescriptor(new Patterns.QA()) - { - Example = "QA58DOHB00001234567890ABCDEFG" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a21!c"), 4) - { - Example = "DOHB00001234567890ABCDEFG" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "DOHB" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00001234567890ABCDEFG", - LastUpdatedDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2014, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Romania - yield return new IbanCountry("RO") - { - NativeName = "România", - EnglishName = "Romania", - Iban = new PatternDescriptor(new Patterns.RO()) - { - Example = "RO49AAAA1B31007593840000" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a16!c"), 4) - { - Example = "AAAA1B31007593840000" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "AAAA" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "RO49 AAAA 1B31 0075 9384 0000", - LastUpdatedDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Serbia - yield return new IbanCountry("RS") - { - NativeName = "Srbija", - EnglishName = "Serbia", - Iban = new PatternDescriptor(new Patterns.RS()) - { - Example = "RS35260005601001611379" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n13!n2!n"), 4) - { - Example = "260005601001611379" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "260" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "260-0056010016113-79", - LastUpdatedDate = new DateTimeOffset(2017, 3, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Saudi Arabia - yield return new IbanCountry("SA") - { - NativeName = "المملكة العربية السعودية", - EnglishName = "Saudi Arabia", - Iban = new PatternDescriptor(new Patterns.SA()) - { - Example = "SA0380000000608010167519" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!n18!c"), 4) - { - Example = "80000000608010167519" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "80" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "608010167519", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Seychelles - yield return new IbanCountry("SC") - { - NativeName = "Seychelles", - EnglishName = "Seychelles", - Iban = new PatternDescriptor(new Patterns.SC()) - { - Example = "SC18SSCB11010000000000001497USD" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a2!n2!n16!n3!a"), 4) - { - Example = "SSCB11010000000000001497USD" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a2!n"), 4) - { - Example = "SSCB11" - }, - Branch = new PatternDescriptor(new SwiftPattern("2!n"), 10) - { - Example = "01" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0000000000001497", - LastUpdatedDate = new DateTimeOffset(2019, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Sudan - yield return new IbanCountry("SD") - { - NativeName = "السودان", - EnglishName = "Sudan", - Iban = new PatternDescriptor(new Patterns.SD()) - { - Example = "SD2129010501234001" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!n12!n"), 4) - { - Example = "29010501234001" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "29" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "010501234001", - LastUpdatedDate = new DateTimeOffset(2021, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2021, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Sweden - yield return new IbanCountry("SE") - { - NativeName = "Sverige", - EnglishName = "Sweden", - Iban = new PatternDescriptor(new Patterns.SE()) - { - Example = "SE4550000000058398257466" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n16!n1!n"), 4) - { - Example = "50000000058398257466" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "123" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "1234 12 3456 1", - LastUpdatedDate = new DateTimeOffset(2009, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Slovenia - yield return new IbanCountry("SI") - { - NativeName = "Slovenija", - EnglishName = "Slovenia", - Iban = new PatternDescriptor(new Patterns.SI()) - { - Example = "SI56263300012039086" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n8!n2!n"), 4) - { - Example = "263300012039086" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "26330" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "2633 0001 2039 086", - LastUpdatedDate = new DateTimeOffset(2016, 10, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Slovakia - yield return new IbanCountry("SK") - { - NativeName = "Slovensko", - EnglishName = "Slovakia", - Iban = new PatternDescriptor(new Patterns.SK()) - { - Example = "SK3112000000198742637541" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n6!n10!n"), 4) - { - Example = "12000000198742637541" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "1200" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "19-8742637541/1200", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // San Marino - yield return new IbanCountry("SM") - { - NativeName = "San Marino", - EnglishName = "San Marino", - Iban = new PatternDescriptor(new Patterns.SM()) - { - Example = "SM86U0322509800000000270100" - }, - Bban = new PatternDescriptor(new SwiftPattern("1!a5!n5!n12!c"), 4) - { - Example = "U0322509800000000270100" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 5) - { - Example = "03225" - }, - Branch = new PatternDescriptor(new SwiftPattern("5!n"), 10) - { - Example = "09800" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 8, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 8, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Somalia - yield return new IbanCountry("SO") - { - NativeName = "الصومال", - EnglishName = "Somalia", - Iban = new PatternDescriptor(new Patterns.SO()) - { - Example = "SO211000001001000100141" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n3!n12!n"), 4) - { - Example = "1000001001000100141" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "1000" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 8) - { - Example = "001" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "001000100141", - LastUpdatedDate = new DateTimeOffset(2023, 2, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2023, 1, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Sao Tome and Principe - yield return new IbanCountry("ST") - { - NativeName = "São Tomé e Príncipe", - EnglishName = "Sao Tome and Principe", - Iban = new PatternDescriptor(new Patterns.ST()) - { - Example = "ST23000100010051845310146" - }, - Bban = new PatternDescriptor(new SwiftPattern("8!n11!n2!n"), 4) - { - Example = "000100010051845310146" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!n"), 4) - { - Example = "0001" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "0001" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "0051845310146", - LastUpdatedDate = new DateTimeOffset(2020, 5, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2020, 3, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // El Salvador - yield return new IbanCountry("SV") - { - NativeName = "El Salvador", - EnglishName = "El Salvador", - Iban = new PatternDescriptor(new Patterns.SV()) - { - Example = "SV62CENR00000000000000700025" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a20!n"), 4) - { - Example = "CENR00000000000000700025" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "CENR" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00000000000000700025", - LastUpdatedDate = new DateTimeOffset(2021, 3, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 12, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Timor-Leste - yield return new IbanCountry("TL") - { - NativeName = "Timor-Leste", - EnglishName = "Timor-Leste", - Iban = new PatternDescriptor(new Patterns.TL()) - { - Example = "TL380080012345678910157" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n14!n2!n"), 4) - { - Example = "0080012345678910157" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "008" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "008 00123456789101 57", - LastUpdatedDate = new DateTimeOffset(2014, 11, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2014, 9, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Tunisia - yield return new IbanCountry("TN") - { - NativeName = "تونس", - EnglishName = "Tunisia", - Iban = new PatternDescriptor(new Patterns.TN()) - { - Example = "TN5910006035183598478831" - }, - Bban = new PatternDescriptor(new SwiftPattern("2!n3!n13!n2!n"), 4) - { - Example = "10006035183598478831" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "10" - }, - Branch = new PatternDescriptor(new SwiftPattern("3!n"), 6) - { - Example = "006" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "10 006 0351835984788 31", - LastUpdatedDate = new DateTimeOffset(2016, 5, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Turkey - yield return new IbanCountry("TR") - { - NativeName = "Türkiye", - EnglishName = "Turkey", - Iban = new PatternDescriptor(new Patterns.TR()) - { - Example = "TR330006100519786457841326" - }, - Bban = new PatternDescriptor(new SwiftPattern("5!n1!n16!c"), 4) - { - Example = "0006100519786457841326" - }, - Bank = new PatternDescriptor(new SwiftPattern("5!n"), 4) - { - Example = "00061" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2007, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Ukraine - yield return new IbanCountry("UA") - { - NativeName = "Україна", - EnglishName = "Ukraine", - Iban = new PatternDescriptor(new Patterns.UA()) - { - Example = "UA213223130000026007233566001" - }, - Bban = new PatternDescriptor(new SwiftPattern("6!n19!c"), 4) - { - Example = "3223130000026007233566001" - }, - Bank = new PatternDescriptor(new SwiftPattern("6!n"), 4) - { - Example = "322313" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "26007233566001", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2016, 2, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Vatican City State - yield return new IbanCountry("VA") - { - NativeName = "Città del Vaticano", - EnglishName = "Vatican City State", - Iban = new PatternDescriptor(new Patterns.VA()) - { - Example = "VA59001123000012345678" - }, - Bban = new PatternDescriptor(new SwiftPattern("3!n15!n"), 4) - { - Example = "001123000012345678" - }, - Bank = new PatternDescriptor(new SwiftPattern("3!n"), 4) - { - Example = "001" - }, - Sepa = new SepaInfo - { - IsMember = true - }, - DomesticAccountNumberExample = "123000012345678", - LastUpdatedDate = new DateTimeOffset(2018, 12, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2019, 3, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Virgin Islands - yield return new IbanCountry("VG") - { - NativeName = "British Virgin Islands", - EnglishName = "Virgin Islands", - Iban = new PatternDescriptor(new Patterns.VG()) - { - Example = "VG96VPVG0000012345678901" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a16!n"), 4) - { - Example = "VPVG0000012345678901" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "VPVG" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "00000 12 345 678 901", - LastUpdatedDate = new DateTimeOffset(2014, 6, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2012, 4, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Kosovo - yield return new IbanCountry("XK") - { - NativeName = "Kosovë", - EnglishName = "Kosovo", - Iban = new PatternDescriptor(new Patterns.XK()) - { - Example = "XK051212012345678906" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!n10!n2!n"), 4) - { - Example = "1212012345678906" - }, - Bank = new PatternDescriptor(new SwiftPattern("2!n"), 4) - { - Example = "12" - }, - Branch = new PatternDescriptor(new SwiftPattern("2!n"), 6) - { - Example = "12" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "1212 0123456789 06", - LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2014, 9, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // Yemen - yield return new IbanCountry("YE") - { - NativeName = "اليمن", - EnglishName = "Yemen", - Iban = new PatternDescriptor(new Patterns.YE()) - { - Example = "YE15CBYE0001018861234567891234" - }, - Bban = new PatternDescriptor(new SwiftPattern("4!a4!n18!c"), 4) - { - Example = "CBYE0001018861234567891234" - }, - Bank = new PatternDescriptor(new SwiftPattern("4!a"), 4) - { - Example = "CBYE" - }, - Branch = new PatternDescriptor(new SwiftPattern("4!n"), 8) - { - Example = "0001" - }, - Sepa = new SepaInfo - { - IsMember = false - }, - DomesticAccountNumberExample = "018861234567891234", - LastUpdatedDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(2024, 7, 1, 0, 0, 0, TimeSpan.Zero) - }; - - // ReSharper restore StringLiteralTypo - // ReSharper restore CommentTypo - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - private static class Patterns - { - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class AD() : SwiftPattern("AD2!n4!n4!n12!c", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'A' - && value[pos++] == 'D' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class AE() : SwiftPattern("AE2!n3!n16!n", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'A' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class AL() : SwiftPattern("AL2!n8!n16!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'A' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class AT() : SwiftPattern("AT2!n5!n11!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'A' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class AZ() : SwiftPattern("AZ2!n4!a20!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'A' - && value[pos++] == 'Z' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BA() : SwiftPattern("BA2!n3!n3!n8!n2!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'A' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BE() : SwiftPattern("BE2!n3!n7!n2!n", 16, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BG() : SwiftPattern("BG2!n4!a4!n2!n8!c", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'G' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BH() : SwiftPattern("BH2!n4!a14!c", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'H' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BI() : SwiftPattern("BI2!n5!n5!n11!n2!n", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BR() : SwiftPattern("BR2!n8!n5!n10!n1!a1!c", 29, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class BY() : SwiftPattern("BY2!n4!c4!n16!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'B' - && value[pos++] == 'Y' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class CH() : SwiftPattern("CH2!n5!n12!c", 21, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'C' - && value[pos++] == 'H' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class CR() : SwiftPattern("CR2!n4!n14!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'C' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class CY() : SwiftPattern("CY2!n3!n5!n16!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'C' - && value[pos++] == 'Y' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class CZ() : SwiftPattern("CZ2!n4!n6!n10!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'C' - && value[pos++] == 'Z' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class DE() : SwiftPattern("DE2!n8!n10!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'D' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class DJ() : SwiftPattern("DJ2!n5!n5!n11!n2!n", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'D' - && value[pos++] == 'J' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class DK() : SwiftPattern("DK2!n4!n9!n1!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'D' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class DO() : SwiftPattern("DO2!n4!c20!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'D' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class EE() : SwiftPattern("EE2!n2!n14!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'E' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } + public int Count { get => _countries.Value.Count; } - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class EG() : SwiftPattern("EG2!n4!n4!n17!n", 29, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'E' - && value[pos++] == 'G' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class ES() : SwiftPattern("ES2!n4!n4!n1!n1!n10!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'E' - && value[pos++] == 'S' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class FI() : SwiftPattern("FI2!n3!n11!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'F' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class FK() : SwiftPattern("FK2!n2!a12!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'F' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class FO() : SwiftPattern("FO2!n4!n9!n1!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'F' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class FR() : SwiftPattern("FR2!n5!n5!n11!c2!n", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'F' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GB() : SwiftPattern("GB2!n4!a6!n8!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'B' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GE() : SwiftPattern("GE2!n2!a16!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GI() : SwiftPattern("GI2!n4!a15!c", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GL() : SwiftPattern("GL2!n4!n9!n1!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GR() : SwiftPattern("GR2!n3!n4!n16!c", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class GT() : SwiftPattern("GT2!n4!c20!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'G' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class HN() : SwiftPattern("HN2!n4!a20!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'H' - && value[pos++] == 'N' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class HR() : SwiftPattern("HR2!n7!n10!n", 21, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'H' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class HU() : SwiftPattern("HU2!n3!n4!n1!n15!n1!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'H' - && value[pos++] == 'U' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class IE() : SwiftPattern("IE2!n4!a6!n8!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'I' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class IL() : SwiftPattern("IL2!n3!n3!n13!n", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'I' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class IQ() : SwiftPattern("IQ2!n4!a3!n12!n", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'I' - && value[pos++] == 'Q' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class IS() : SwiftPattern("IS2!n4!n2!n6!n10!n", 26, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'I' - && value[pos++] == 'S' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class IT() : SwiftPattern("IT2!n1!a5!n5!n12!c", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'I' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class JO() : SwiftPattern("JO2!n4!a4!n18!c", 30, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'J' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class KW() : SwiftPattern("KW2!n4!a22!c", 30, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'K' - && value[pos++] == 'W' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class KZ() : SwiftPattern("KZ2!n3!n13!c", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'K' - && value[pos++] == 'Z' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LB() : SwiftPattern("LB2!n4!n20!c", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'B' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LC() : SwiftPattern("LC2!n4!a24!c", 32, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'C' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LI() : SwiftPattern("LI2!n5!n12!c", 21, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LT() : SwiftPattern("LT2!n5!n11!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LU() : SwiftPattern("LU2!n3!n13!c", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'U' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LV() : SwiftPattern("LV2!n4!a13!c", 21, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'V' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class LY() : SwiftPattern("LY2!n3!n3!n15!n", 25, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'L' - && value[pos++] == 'Y' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MC() : SwiftPattern("MC2!n5!n5!n11!c2!n", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'C' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MD() : SwiftPattern("MD2!n2!c18!c", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'D' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class ME() : SwiftPattern("ME2!n3!n13!n2!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MK() : SwiftPattern("MK2!n3!n10!c2!n", 19, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MN() : SwiftPattern("MN2!n4!n12!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'N' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MR() : SwiftPattern("MR2!n5!n5!n11!n2!n", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MT() : SwiftPattern("MT2!n4!a5!n18!c", 31, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class MU() : SwiftPattern("MU2!n4!a2!n2!n12!n3!n3!a", 30, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'M' - && value[pos++] == 'U' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class NI() : SwiftPattern("NI2!n4!a20!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'N' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class NL() : SwiftPattern("NL2!n4!a10!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'N' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class NO() : SwiftPattern("NO2!n4!n6!n1!n", 15, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'N' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class OM() : SwiftPattern("OM2!n3!n16!c", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'O' - && value[pos++] == 'M' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class PK() : SwiftPattern("PK2!n4!a16!c", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'P' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class PL() : SwiftPattern("PL2!n8!n16!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'P' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class PS() : SwiftPattern("PS2!n4!a21!c", 29, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'P' - && value[pos++] == 'S' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class PT() : SwiftPattern("PT2!n4!n4!n11!n2!n", 25, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'P' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class QA() : SwiftPattern("QA2!n4!a21!c", 29, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'Q' - && value[pos++] == 'A' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class RO() : SwiftPattern("RO2!n4!a16!c", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'R' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class RS() : SwiftPattern("RS2!n3!n13!n2!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'R' - && value[pos++] == 'S' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SA() : SwiftPattern("SA2!n2!n18!c", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'A' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SC() : SwiftPattern("SC2!n4!a2!n2!n16!n3!a", 31, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'C' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SD() : SwiftPattern("SD2!n2!n12!n", 18, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'D' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SE() : SwiftPattern("SE2!n3!n16!n1!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SI() : SwiftPattern("SI2!n5!n8!n2!n", 19, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'I' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SK() : SwiftPattern("SK2!n4!n6!n10!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SM() : SwiftPattern("SM2!n1!a5!n5!n12!c", 27, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'M' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SO() : SwiftPattern("SO2!n4!n3!n12!n", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'O' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class ST() : SwiftPattern("ST2!n8!n11!n2!n", 25, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'T' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class SV() : SwiftPattern("SV2!n4!a20!n", 28, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'S' - && value[pos++] == 'V' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class TL() : SwiftPattern("TL2!n3!n14!n2!n", 23, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'T' - && value[pos++] == 'L' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class TN() : SwiftPattern("TN2!n2!n3!n13!n2!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'T' - && value[pos++] == 'N' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class TR() : SwiftPattern("TR2!n5!n1!n16!c", 26, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'T' - && value[pos++] == 'R' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class UA() : SwiftPattern("UA2!n6!n19!c", 29, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'U' - && value[pos++] == 'A' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class VA() : SwiftPattern("VA2!n3!n15!n", 22, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'V' - && value[pos++] == 'A' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class VG() : SwiftPattern("VG2!n4!a16!n", 24, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'V' - && value[pos++] == 'G' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class XK() : SwiftPattern("XK2!n4!n10!n2!n", 20, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'X' - && value[pos++] == 'K' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-r99")] - internal sealed class YE() : SwiftPattern("YE2!n4!a4!n18!c", 30, true) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == 'Y' - && value[pos++] == 'E' - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsUpperAsciiLetter() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAsciiDigit() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - && value[pos++].IsAlphaNumeric() - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } - } + [RegistrySource(RegistrySource.Swift, @"Files\swift_iban_registry_202412.r99.txt")] + private static partial IEnumerable Load(); } diff --git a/src/IbanNet/Registry/Swift/SwiftRegistryProvider.tt b/src/IbanNet/Registry/Swift/SwiftRegistryProvider.tt deleted file mode 100644 index 29aa47b3..00000000 --- a/src/IbanNet/Registry/Swift/SwiftRegistryProvider.tt +++ /dev/null @@ -1,230 +0,0 @@ -<#@ template hostspecific="true" language="C#" visibility="internal" debug="true" #> -<#@ assembly name="NetStandard" #> -<#@ assembly name="System.Core" #> -<#@ assembly name="$(SolutionDir)\src\IbanNet.CodeGen\bin\$(Configuration)\netstandard2.0\IbanNet.CodeGen.dll" #> -<#@ assembly name="$(SolutionDir)\src\IbanNet.CodeGen\bin\$(Configuration)\netstandard2.0\CsvHelper.dll" #> -<#@ assembly name="$(SolutionDir)\src\IbanNet\bin\$(Configuration)\netstandard2.0\IbanNet.dll" #> -<#@ import namespace="System.IO" #> -<#@ import namespace="System.Linq" #> -<#@ import namespace="System.Text" #> -<#@ import namespace="IbanNet.CodeGen.Swift" #> -<#@ import namespace="IbanNet.Registry.Patterns" #> -<#@ import namespace="IbanNet.Registry.Swift" #> -<#@ output extension=".cs" #> -using System.CodeDom.Compiler; -using System.Collections; -using System.Diagnostics; -using System.Diagnostics.CodeAnalysis; -using IbanNet.Extensions; -<# - string dataFolder = Path.Combine(Path.GetDirectoryName(this.Host.ResolvePath("SwiftRegistryProvider.tt")), "Files"); - string registryPath = Directory.GetFiles(dataFolder) - .Where(s => s.EndsWith(".txt")) - .OrderBy(s => s) - .Last(); - string registryFile = Path.GetFileName(registryPath); - string registryReleaseVersion = registryFile.Split('.')[1]; -#> - -namespace IbanNet.Registry.Swift; - -/// -/// This IBAN registry provider contains IBAN/BBAN/SEPA information for all known IBAN countries. -/// -/// -/// Generated from: <#= registryFile #> -/// -[GeneratedCode("SwiftRegistryProviderT4", "1.1-<#= registryReleaseVersion #>")] -public class SwiftRegistryProvider : IIbanRegistryProvider -{ - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private ICollection? _countries; - - /// - public IEnumerator GetEnumerator() - { - _countries = _countries ??= Load().ToList(); - - return _countries.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - // ReSharper disable once UseCollectionCountProperty - justification: need to init _countries first. - public int Count => _countries?.Count ?? this.Count(); - - private static IEnumerable Load() - { - // ReSharper disable CommentTypo - // ReSharper disable StringLiteralTypo - -<# - var csv = new SwiftCsvReader(new StreamReader(registryPath, Encoding.GetEncoding(1252))); - var records = csv.GetRecords() - .Select(IbanNet.CodeGen.Swift.Patches.RecordPatcher.ApplyAll) - .Where(record => !Boycott(record.CountryCode)) - .OrderBy(record => record.CountryCode) - .ToArray(); - - foreach (var record in records) - { - int bbanOffset = record.Iban.Length - record.Bban.Length; -#> - // <#= record.EnglishName #> - yield return new IbanCountry("<#= record.CountryCode #>") - { - NativeName = "<#= record.NativeName #>", - EnglishName = "<#= record.EnglishName #>", -<# - if (record.OtherTerritories.Count > 0) { -#> - IncludedCountries = - [ - <# - WriteLine(string.Join(", ", record.OtherTerritories.Select(r => $"\"{r.Substring(0, 2).ToUpperInvariant()}\""))); -#> - ], -<# - } - -#> - Iban = new PatternDescriptor(new Patterns.<#= record.CountryCode #>()) - { - Example = "<#= record.Iban.ElectronicFormatExample ?? string.Empty #>" - }, - Bban = new PatternDescriptor(new SwiftPattern("<#= record.Bban.Pattern #>"), <#= bbanOffset #>) - { - Example = "<#= record.Bban.Example ?? string.Empty #>" - }, -<# - if (record.Bank.Pattern is not null && record.Bank.Position.HasValue) { -#> - Bank = new PatternDescriptor(new SwiftPattern("<#= record.Bank.Pattern #>"), <#= bbanOffset + record.Bank.Position.Value.StartPos #>) - { - Example = "<#= record.Bank.Example ?? string.Empty #>" - }, -<# - } - - if (record.Branch.Pattern is not null && record.Branch.Position.HasValue) { -#> - Branch = new PatternDescriptor(new SwiftPattern("<#= record.Branch.Pattern #>"), <#= bbanOffset + record.Branch.Position.Value.StartPos #>) - { - Example = "<#= record.Branch.Example ?? string.Empty #>" - }, -<# - } -#> - Sepa = new SepaInfo - { - IsMember = <#= record.Sepa.IsMember.ToString().ToLowerInvariant() + (record.Sepa.OtherTerritories.Count > 0 ? "," : "") #> -<# - if (record.Sepa.OtherTerritories.Count > 0) { -#> - IncludedCountries = - [ - <# - WriteLine(string.Join(", ", record.Sepa.OtherTerritories.Select(r => $"\"{r.Substring(0, 2).ToUpperInvariant()}\""))); -#> - ] -<# - } -#> - }, - DomesticAccountNumberExample = "<#= record.DomesticExample ?? string.Empty #>", - LastUpdatedDate = new DateTimeOffset(<#= record.LastUpdatedDate.Year #>, <#= record.LastUpdatedDate.Month #>, 1, 0, 0, 0, TimeSpan.Zero), - EffectiveDate = new DateTimeOffset(<#= record.EffectiveDate.Year #>, <#= record.EffectiveDate.Month #>, 1, 0, 0, 0, TimeSpan.Zero) - }; - -<# - } -#> - // ReSharper restore StringLiteralTypo - // ReSharper restore CommentTypo - } - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-<#= registryReleaseVersion #>")] - private static class Patterns - { -<# - foreach (var record in records) - { - var pattern = record.Iban.SwiftPattern; -#> - - [GeneratedCode("SwiftRegistryProviderT4", "1.1-<#= registryReleaseVersion #>")] - internal sealed class <#= record.CountryCode #>() : SwiftPattern("<#= pattern.ToString() #>", <#= pattern.MaxLength #>, <#= pattern.IsFixedLength.ToString().ToLower() #>) - { -#if USE_SPANS - internal override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) -#else - internal override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) -#endif - { - int pos = 0; - if (value.Length == MaxLength - && value[pos++] == '<#= record.CountryCode[0] #>' - && value[pos++] == '<#= record.CountryCode[1] #>' -<# - foreach (var token in pattern.Tokens - .Skip(1) // Skip country code token. - .SelectMany(token => Enumerable.Range(0, token.MaxLength).Select(_ => token)) - ) - { - if (!token.IsFixedLength) - { - throw new InvalidOperationException("Can't optimize for non-fixed length."); - } - - if (token.Category == AsciiCategory.Space) { -#> - && value[pos++] == ' ' -<# - } else if (token.Category == AsciiCategory.Digit) { -#> - && value[pos++].IsAsciiDigit() -<# - } else if (token.Category == AsciiCategory.AlphaNumeric) { -#> - && value[pos++].IsAlphaNumeric() -<# - } else if (token.Category == AsciiCategory.UppercaseLetter) { -#> - && value[pos++].IsUpperAsciiLetter() -<# - } else if (token.Category == AsciiCategory.LowercaseLetter) { -#> - && value[pos++].IsLowerAsciiLetter() -<# - } else if (token.Category == AsciiCategory.Letter) { -#> - && value[pos++].IsAsciiLetter() -<# - } - } -#> - ) - { - errorPos = null; - return true; - } - - errorPos = pos - 1; - return false; - } - } -<# - } -#> - } -} -<#+ -private static bool Boycott(string countryCode) -{ - return countryCode == "RU"; // Go Ukraine! -} -#> diff --git a/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj b/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj index 709b0f41..4ef0d5fd 100644 --- a/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj +++ b/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj @@ -3,6 +3,8 @@ net8.0 true + IbanNet.CodeGen + $(NoWarn);MSB3243 diff --git a/test/IbanNet.CodeGen.Tests/SwiftCsvReaderTests.cs b/test/IbanNet.CodeGen.Tests/Swift/SwiftCsvReaderTests.cs similarity index 72% rename from test/IbanNet.CodeGen.Tests/SwiftCsvReaderTests.cs rename to test/IbanNet.CodeGen.Tests/Swift/SwiftCsvReaderTests.cs index 4ae051cd..8f7e597f 100644 --- a/test/IbanNet.CodeGen.Tests/SwiftCsvReaderTests.cs +++ b/test/IbanNet.CodeGen.Tests/Swift/SwiftCsvReaderTests.cs @@ -1,33 +1,12 @@ using System.Text; -using IbanNet.CodeGen.Swift; -namespace IbanNet.CodeGen.Tests; +namespace IbanNet.CodeGen.Swift; public class SwiftCsvReaderTests { - private static readonly string TestCsvData; - static SwiftCsvReaderTests() { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); - - string dataFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, - "..", - "..", - "..", - "..", - "..", - "src", - "IbanNet", - "Registry", - "Swift", - "Files" - ); - string registryPath = Directory.GetFiles(dataFolder) - .Where(s => s.EndsWith(".txt")) - .OrderBy(s => s) - .Last(); - TestCsvData = File.ReadAllText(registryPath, Encoding.GetEncoding(1252)); } [Theory] diff --git a/test/IbanNet.Tests/Registry/Swift/Snapshots/SwiftRegistryProvider.verified.txt b/test/IbanNet.Tests/Registry/Swift/Snapshots/SwiftRegistryProvider.verified.txt index 0918d906..64a4319d 100644 --- a/test/IbanNet.Tests/Registry/Swift/Snapshots/SwiftRegistryProvider.verified.txt +++ b/test/IbanNet.Tests/Registry/Swift/Snapshots/SwiftRegistryProvider.verified.txt @@ -695,7 +695,6 @@ Sepa: { IsMember: true }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 18, @@ -2354,7 +2353,6 @@ AX ] }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 14, @@ -4771,7 +4769,6 @@ Sepa: { IsMember: true }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 16, @@ -4858,7 +4855,6 @@ Sepa: { IsMember: true }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 16, @@ -7614,7 +7610,6 @@ Sepa: { IsMember: true }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 23, @@ -8258,7 +8253,6 @@ Sepa: { IsMember: false }, - DomesticAccountNumberExample: , Bban: { Position: 4, Length: 22, From d9ef50b175ed7300c5d2b52751e79e2ba11b0fd7 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Sun, 28 Sep 2025 01:30:31 +0200 Subject: [PATCH 3/7] chore: remove SwiftPattern --- src/IbanNet.CodeGen/IbanNet.CodeGen.csproj | 2 - src/IbanNet.CodeGen/Swift/PatternWrapper.cs | 11 +- src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs | 3 - src/IbanNet/Registry/Swift/SwiftPattern.cs | 78 ----------- .../Registry/Swift/SwiftPatternTests.cs | 121 ------------------ 5 files changed, 1 insertion(+), 214 deletions(-) delete mode 100644 src/IbanNet/Registry/Swift/SwiftPattern.cs delete mode 100644 test/IbanNet.Tests/Registry/Swift/SwiftPatternTests.cs diff --git a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj index 554834ef..d0760635 100644 --- a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj +++ b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj @@ -26,9 +26,7 @@ - - diff --git a/src/IbanNet.CodeGen/Swift/PatternWrapper.cs b/src/IbanNet.CodeGen/Swift/PatternWrapper.cs index cad17a33..e5224f1a 100644 --- a/src/IbanNet.CodeGen/Swift/PatternWrapper.cs +++ b/src/IbanNet.CodeGen/Swift/PatternWrapper.cs @@ -1,14 +1,5 @@ using IbanNet.Registry.Patterns; -using IbanNet.Registry.Swift; namespace IbanNet.CodeGen.Swift; -internal sealed class PatternWrapper(string pattern, ITokenizer tokenizer) : Pattern(pattern, tokenizer) -{ - private string? _pattern; - - public override string ToString() - { - return _pattern ??= SwiftPattern.Format(Tokens); - } -} +internal sealed class PatternWrapper(string pattern, ITokenizer tokenizer) : Pattern(pattern, tokenizer); diff --git a/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs b/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs index 00623105..13a5306c 100644 --- a/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs +++ b/src/IbanNet.CodeGen/Swift/SwiftCsvRecord.cs @@ -2,7 +2,6 @@ using CsvHelper.Configuration.Attributes; using IbanNet.CodeGen.Swift.Converters; using IbanNet.Registry.Patterns; -using IbanNet.Registry.Swift; namespace IbanNet.CodeGen.Swift; @@ -80,8 +79,6 @@ public record IbanCsvData [Name("IBAN structure")] public string Pattern { get; set; } = default!; - public Pattern SwiftPattern => new PatternWrapper(Pattern, new SwiftPatternTokenizer()); - [Name("IBAN length")] public int Length { get; set; } diff --git a/src/IbanNet/Registry/Swift/SwiftPattern.cs b/src/IbanNet/Registry/Swift/SwiftPattern.cs deleted file mode 100644 index c7a7016c..00000000 --- a/src/IbanNet/Registry/Swift/SwiftPattern.cs +++ /dev/null @@ -1,78 +0,0 @@ -using IbanNet.Registry.Patterns; - -namespace IbanNet.Registry.Swift; - -/// -internal class SwiftPattern : Pattern -{ - private static readonly SwiftPatternTokenizer Tokenizer = new(); - private readonly string _pattern; - private readonly int? _maxLength; - private readonly bool? _isFixedLength; - - /// - public SwiftPattern(string pattern) : base(pattern, Tokenizer) - { - _pattern = pattern; - } - - /// - internal SwiftPattern(string pattern, int maxLength, bool isFixedLength) - : this(pattern) - { - _maxLength = maxLength; - _isFixedLength = isFixedLength; - } - - /// - public override bool IsFixedLength - { - get - { - return _isFixedLength ?? base.IsFixedLength; - } - } - - /// - public override int MaxLength - { - get - { - return _maxLength ?? base.MaxLength; - } - } - - /// - public override string ToString() - { - return _pattern; - } - - internal static string Format(IEnumerable tokens) - { - return string.Join("", tokens.Select(FormatToken)); - } - - private static string FormatToken(PatternToken t) - { - if (t.Value is not null) - { - return t.Value; - } - - string fixedLen = t.IsFixedLength ? "!" : string.Empty; - return $"{t.MaxLength}{fixedLen}{GetToken(t.Category)}"; - } - - private static char GetToken(AsciiCategory category) - { - return category switch - { - AsciiCategory.Digit => 'n', - AsciiCategory.UppercaseLetter => 'a', - AsciiCategory.AlphaNumeric => 'c', - AsciiCategory.Space => 'e', - _ => throw new InvalidOperationException() - }; - } -} diff --git a/test/IbanNet.Tests/Registry/Swift/SwiftPatternTests.cs b/test/IbanNet.Tests/Registry/Swift/SwiftPatternTests.cs deleted file mode 100644 index 97b73fd0..00000000 --- a/test/IbanNet.Tests/Registry/Swift/SwiftPatternTests.cs +++ /dev/null @@ -1,121 +0,0 @@ -using IbanNet.Registry.Patterns; - -namespace IbanNet.Registry.Swift; - -public class SwiftPatternTests -{ - [Fact] - public void When_creating_with_null_pattern_it_should_throw() - { - string? pattern = null; - - // Act - Func act = () => new SwiftPattern(pattern!); - - // Assert - act.Should() - .Throw() - .WithParameterName(nameof(pattern)); - } - - [Theory] - [MemberData(nameof(GetTestCases))] - public void Given_pattern_when_calling_to_string_should_return_same_pattern(string pattern, IEnumerable _) - { - // Act - var actual = new SwiftPattern(pattern); - - // Assert - actual.ToString().Should().Be(pattern); - } - - [Theory] - [MemberData(nameof(GetTestCases))] - public void Given_pattern_tokens_when_formatting_it_should_return_expected_pattern(string expectedPattern, IEnumerable tokens) - { - // Act - string actual = SwiftPattern.Format(tokens); - - // Assert - actual.Should().Be(expectedPattern); - } - - [Theory] - [MemberData(nameof(GetTestCases))] - public void Given_pattern_when_getting_tokens_it_should_return_expected(string pattern, IEnumerable expectedTokens) - { - // Act - var actual = new SwiftPattern(pattern); - - // Assert - actual.Tokens.Should().BeEquivalentTo(expectedTokens); - } - - [Theory] - [InlineData("2!n4!a4!n2!n8!c", true)] - [InlineData("2!n4!a4!n2n8!c", false)] - [InlineData("4!n", true)] - [InlineData("4n", false)] - public void Given_pattern_when_getting_isFixedLength_it_should_return_expected(string pattern, bool expectedIsFixedLength) - { - // Act - var actual = new SwiftPattern(pattern); - - // Assert - actual.IsFixedLength.Should().Be(expectedIsFixedLength); - } - - public static IEnumerable GetTestCases() - { - yield return - [ - "2!n4!a4!n2!n8!c", - new List - { - new(AsciiCategory.Digit, 2), - new(AsciiCategory.UppercaseLetter, 4), - new(AsciiCategory.Digit, 4), - new(AsciiCategory.Digit, 2), - new(AsciiCategory.AlphaNumeric, 8) - } - ]; - - yield return - [ - "4!n10a1!e2!c", - new List - { - new(AsciiCategory.Digit, 4), - new(AsciiCategory.UppercaseLetter, 1, 10), - new(AsciiCategory.Space, 1), - new(AsciiCategory.AlphaNumeric, 2) - } - ]; - - yield return - [ - "AD2!n4!n4!n12!c", - new List - { - new("AD"), - new(AsciiCategory.Digit, 2, 2), - new(AsciiCategory.Digit, 4, 4), - new(AsciiCategory.Digit, 4, 4), - new(AsciiCategory.AlphaNumeric, 12, 12) - } - ]; - } - - [Theory] - [InlineData("AD2!n4!n4!n12!c", "^AD\\d{10}[a-zA-Z0-9]{12}$")] - [InlineData("NL2!n4!a10!n", "^NL\\d{2}[A-Z]{4}\\d{10}$")] - [InlineData("NO2!n4!n6!n1!n", "^NO\\d{13}$")] - [InlineData("PT2!n4!n4!n11!n2!n", "^PT\\d{23}$")] - [InlineData("SM2!n1!a5!n5!n12!c", "^SM\\d{2}[A-Z]\\d{10}[a-zA-Z0-9]{12}$")] - public void When_getting_regexPattern_it_should_return_expected(string ibanPattern, string regexPattern) - { - var sut = new SwiftPattern(ibanPattern); - - sut.ToRegexPattern().Should().Be(regexPattern); - } -} From fa24cbc891ec48ea5758550d97c001727054bbf3 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Mon, 29 Sep 2025 00:17:43 +0200 Subject: [PATCH 4/7] test: remove direct usages of SwiftPatternTokenizer --- .../IbanNet.CodeGen.Tests.csproj | 4 + test/IbanNet.Tests/IbanTests.cs | 44 ++++---- test/IbanNet.Tests/IbanValidatorTests.cs | 39 +++++-- .../Registry/Patterns/TestPattern.cs | 20 ++++ .../Swift/ExpectedDefinitionsSubset.cs | 100 +++++++++++++++--- .../Rules/IsMatchingStructureRuleTests.cs | 28 +++-- 6 files changed, 178 insertions(+), 57 deletions(-) diff --git a/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj b/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj index 4ef0d5fd..eed5cbfa 100644 --- a/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj +++ b/test/IbanNet.CodeGen.Tests/IbanNet.CodeGen.Tests.csproj @@ -7,6 +7,10 @@ $(NoWarn);MSB3243 + + + + diff --git a/test/IbanNet.Tests/IbanTests.cs b/test/IbanNet.Tests/IbanTests.cs index 9eeb548e..8782ea84 100644 --- a/test/IbanNet.Tests/IbanTests.cs +++ b/test/IbanNet.Tests/IbanTests.cs @@ -1,6 +1,5 @@ using IbanNet.Registry; using IbanNet.Registry.Patterns; -using IbanNet.Registry.Swift; using IbanNet.Validation.Results; using TestHelpers; @@ -291,14 +290,19 @@ public void Given_that_patternDescriptor_is_not_known_it_should_return_null() { var ibanCountry = new IbanCountry("NL") { - Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", new SwiftPatternTokenizer())) - { - Example = "NL91ABNA0417164300" - }, - Bban = new PatternDescriptor(new TestPattern("4!a10!n", new SwiftPatternTokenizer()), 4) - { - Example = "ABNA0417164300" - } + Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ])) { Example = "NL91ABNA0417164300" }, + Bban = new PatternDescriptor(new TestPattern("4!a10!n", + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ]), + 4) { Example = "ABNA0417164300" } }; var iban = new Iban(ibanCountry.Iban.Example, ibanCountry); @@ -315,10 +319,13 @@ public void Given_that_bban_patternDescriptor_is_not_known_it_should_not_throw_a { var ibanCountry = new IbanCountry("NL") { - Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", new SwiftPatternTokenizer())) - { - Example = "NL91ABNA0417164300" - } + Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ])) { Example = "NL91ABNA0417164300" } }; var iban = new Iban(ibanCountry.Iban.Example, ibanCountry); @@ -350,8 +357,8 @@ public void Given_an_iban_when_serializing_it_should_return_expected_json(string [Theory] [InlineData(TestValues.ValidIban, "\"" + TestValues.ValidIban + "\"")] - [InlineData(null, "null")] // JSON null. - [InlineData(null, "\"\"")] // Empty string + [InlineData(null, "null")] // JSON null. + [InlineData(null, "\"\"")] // Empty string [InlineData(null, "\" \"")] // String with whitespace public void Given_a_valid_jsonString_when_deserializing_it_should_return_expected_iban(string? expectedIban, string json) { @@ -402,11 +409,7 @@ public void With_invalid_value_should_throw() // Assert IbanFormatException ex = act.Should().Throw("the provided value was invalid").Which; - ex.Result.Should().BeEquivalentTo(new ValidationResult - { - Error = new IllegalCountryCodeCharactersResult(0), - AttemptedValue = TestValues.InvalidIban - }); + ex.Result.Should().BeEquivalentTo(new ValidationResult { Error = new IllegalCountryCodeCharactersResult(0), AttemptedValue = TestValues.InvalidIban }); ex.InnerException.Should().BeNull(); } @@ -485,5 +488,4 @@ public void With_valid_value_should_pass() .Be(TestValues.ValidIban); } } - } diff --git a/test/IbanNet.Tests/IbanValidatorTests.cs b/test/IbanNet.Tests/IbanValidatorTests.cs index aadf2ea4..e482d496 100644 --- a/test/IbanNet.Tests/IbanValidatorTests.cs +++ b/test/IbanNet.Tests/IbanValidatorTests.cs @@ -1,7 +1,5 @@ using IbanNet.Registry; using IbanNet.Registry.Patterns; -using IbanNet.Registry.Swift; -using IbanNet.Registry.Wikipedia; using IbanNet.Validation; using IbanNet.Validation.Results; using IbanNet.Validation.Rules; @@ -102,10 +100,7 @@ public Given_custom_rule_is_added() .Validate(Arg.Any()) .Returns(ValidationRuleResult.Success); - _sut = new IbanValidator(new IbanValidatorOptions - { - Rules = { _customValidationRuleMock } - }); + _sut = new IbanValidator(new IbanValidatorOptions { Rules = { _customValidationRuleMock } }); } [Fact] @@ -170,9 +165,35 @@ public class Given_multiple_providers : IbanValidatorTests { private readonly IbanValidator _sut; - private readonly IbanCountry _correctNlCountry = new("NL") { Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", new SwiftPatternTokenizer())) }; - private readonly IbanCountry _ignoredNlCountry = new("NL") { Iban = new PatternDescriptor(new IbanWikipediaPattern("NL", "50a")) }; - private readonly IbanCountry _correctGbCountry = new("GB") { Iban = new PatternDescriptor(new IbanWikipediaPattern("GB", "4a,14n")) }; + private readonly IbanCountry _correctNlCountry = new("NL") + { + Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ])) + }; + private readonly IbanCountry _ignoredNlCountry = new("NL") + { + Iban = new PatternDescriptor(new TestPattern("50a", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 50) + ])) + }; + private readonly IbanCountry _correctGbCountry = new("GB") + { + Iban = new PatternDescriptor(new TestPattern("4a,14n", + [ + new PatternToken("GB"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 14) + ])) + }; private readonly List _countries; diff --git a/test/IbanNet.Tests/Registry/Patterns/TestPattern.cs b/test/IbanNet.Tests/Registry/Patterns/TestPattern.cs index 9b5981c5..489dc658 100644 --- a/test/IbanNet.Tests/Registry/Patterns/TestPattern.cs +++ b/test/IbanNet.Tests/Registry/Patterns/TestPattern.cs @@ -2,11 +2,31 @@ internal sealed class TestPattern : Pattern { + private readonly string? _pattern; + public TestPattern(string pattern, ITokenizer tokenizer) : base(pattern, tokenizer) { + _pattern = pattern; } public TestPattern(IEnumerable tokens) : base(tokens) { } + + public TestPattern(string pattern, int maxLength, bool isFixedLength, PatternToken[] tokens) + : base(pattern, maxLength, isFixedLength, tokens) + { + _pattern = pattern; + } + + public TestPattern(string pattern, PatternToken[] tokens) + : base(tokens) + { + _pattern = pattern; + } + + public override string ToString() + { + return _pattern ?? base.ToString(); + } } diff --git a/test/IbanNet.Tests/Registry/Swift/ExpectedDefinitionsSubset.cs b/test/IbanNet.Tests/Registry/Swift/ExpectedDefinitionsSubset.cs index 8422713b..0a845b02 100644 --- a/test/IbanNet.Tests/Registry/Swift/ExpectedDefinitionsSubset.cs +++ b/test/IbanNet.Tests/Registry/Swift/ExpectedDefinitionsSubset.cs @@ -7,7 +7,6 @@ internal sealed class ExpectedDefinitionsSubset : IEnumerable { public IEnumerator GetEnumerator() { - var tokenizer = new SwiftPatternTokenizer(); yield return [ new IbanCountry("AD") @@ -15,10 +14,35 @@ public IEnumerator GetEnumerator() DisplayName = "Andorra", NativeName = "Andorra", EnglishName = "Andorra", - Iban = new PatternDescriptor(new TestPattern("AD2!n4!n4!n12!c", tokenizer)) { Example = "AD1200012030200359100100" }, - Bban = new PatternDescriptor(new TestPattern("4!n4!n12!c", tokenizer), 4) { Example = "00012030200359100100" }, - Bank = new PatternDescriptor(new TestPattern("4!n", tokenizer), 4) { Example = "0001" }, - Branch = new PatternDescriptor(new TestPattern("4!n", tokenizer), 8) { Example = "2030" }, + Iban = new PatternDescriptor(new TestPattern("AD2!n4!n4!n12!c", + 24, + true, + [ + new PatternToken("AD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 12) + ])) { Example = "AD1200012030200359100100" }, + Bban = new PatternDescriptor(new TestPattern("4!n4!n12!c", + 20, + true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 12) + ]), + 4) { Example = "00012030200359100100" }, + Bank = new PatternDescriptor(new TestPattern("4!n", + 4, + true, + [new PatternToken(AsciiCategory.Digit, 4)]), + 4) { Example = "0001" }, + Branch = new PatternDescriptor(new TestPattern("4!n", + 4, + true, + [new PatternToken(AsciiCategory.Digit, 4)]), + 8) { Example = "2030" }, Sepa = new SepaInfo { IsMember = true }, DomesticAccountNumberExample = "2030200359100100", LastUpdatedDate = new DateTimeOffset(2021, 3, 1, 0, 0, 0, TimeSpan.Zero), @@ -32,9 +56,22 @@ public IEnumerator GetEnumerator() { NativeName = "Nederland", EnglishName = "Netherlands (The)", - Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", tokenizer)) { Example = "NL91ABNA0417164300" }, - Bban = new PatternDescriptor(new TestPattern("4!a10!n", tokenizer), 4) { Example = "ABNA0417164300" }, - Bank = new PatternDescriptor(new TestPattern("4!a", tokenizer), 4) { Example = "ABNA" }, + Iban = new PatternDescriptor(new TestPattern("NL2!n4!a10!n", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ])) { Example = "NL91ABNA0417164300" }, + Bban = new PatternDescriptor(new TestPattern("4!a10!n", + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10) + ]), + 4) { Example = "ABNA0417164300" }, + Bank = new PatternDescriptor(new TestPattern("4!a", + [new PatternToken(AsciiCategory.UppercaseLetter, 4)]), + 4) { Example = "ABNA" }, Sepa = new SepaInfo { IsMember = true }, DomesticAccountNumberExample = "041 71 64 300", LastUpdatedDate = new DateTimeOffset(2020, 9, 1, 0, 0, 0, TimeSpan.Zero), @@ -48,10 +85,27 @@ public IEnumerator GetEnumerator() { NativeName = "الصومال", EnglishName = "Somalia", - Iban = new PatternDescriptor(new TestPattern("SO2!n4!n3!n12!n", tokenizer)) { Example = "SO211000001001000100141" }, - Bban = new PatternDescriptor(new TestPattern("4!n3!n12!n", tokenizer), 4) { Example = "1000001001000100141" }, - Bank = new PatternDescriptor(new TestPattern("4!n", tokenizer), 4) { Example = "1000" }, - Branch = new PatternDescriptor(new TestPattern("3!n", tokenizer), 8) { Example = "001" }, + Iban = new PatternDescriptor(new TestPattern("SO2!n4!n3!n12!n", + [ + new PatternToken("SO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12) + ])) { Example = "SO211000001001000100141" }, + Bban = new PatternDescriptor(new TestPattern("4!n3!n12!n", + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12) + ]), + 4) { Example = "1000001001000100141" }, + Bank = new PatternDescriptor(new TestPattern("4!n", + [new PatternToken(AsciiCategory.Digit, 4)]), + 4) { Example = "1000" }, + Branch = new PatternDescriptor(new TestPattern("3!n", + [new PatternToken(AsciiCategory.Digit, 3)]), + 8) { Example = "001" }, Sepa = new SepaInfo { IsMember = false }, DomesticAccountNumberExample = "001000100141", LastUpdatedDate = new DateTimeOffset(2023, 2, 1, 0, 0, 0, TimeSpan.Zero), @@ -66,10 +120,24 @@ public IEnumerator GetEnumerator() DisplayName = "Kosovë", NativeName = "Kosovë", EnglishName = "Kosovo", - Iban = new PatternDescriptor(new TestPattern("XK2!n4!n10!n2!n", tokenizer)) { Example = "XK051212012345678906" }, - Bban = new PatternDescriptor(new TestPattern("4!n10!n2!n", tokenizer), 4) { Example = "1212012345678906" }, - Bank = new PatternDescriptor(new TestPattern("2!n", tokenizer), 4) { Example = "12" }, - Branch = new PatternDescriptor(new TestPattern("2!n", tokenizer), 6) { Example = "12" }, + Iban = new PatternDescriptor(new TestPattern("XK2!n4!n10!n2!n", [ + new PatternToken("XK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2) + ])) { Example = "XK051212012345678906" }, + Bban = new PatternDescriptor(new TestPattern("4!n10!n2!n", [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2) + ]), 4) { Example = "1212012345678906" }, + Bank = new PatternDescriptor(new TestPattern("2!n", [ + new PatternToken(AsciiCategory.Digit, 2) + ]), 4) { Example = "12" }, + Branch = new PatternDescriptor(new TestPattern("2!n", [ + new PatternToken(AsciiCategory.Digit, 2) + ]), 6) { Example = "12" }, Sepa = new SepaInfo { IsMember = false }, DomesticAccountNumberExample = "1212 0123456789 06", LastUpdatedDate = new DateTimeOffset(2016, 9, 1, 0, 0, 0, TimeSpan.Zero), diff --git a/test/IbanNet.Tests/Validation/Rules/IsMatchingStructureRuleTests.cs b/test/IbanNet.Tests/Validation/Rules/IsMatchingStructureRuleTests.cs index 81a6dd8b..1d7bf365 100644 --- a/test/IbanNet.Tests/Validation/Rules/IsMatchingStructureRuleTests.cs +++ b/test/IbanNet.Tests/Validation/Rules/IsMatchingStructureRuleTests.cs @@ -1,6 +1,5 @@ using IbanNet.Registry; using IbanNet.Registry.Patterns; -using IbanNet.Registry.Swift; using IbanNet.Validation.Results; namespace IbanNet.Validation.Rules; @@ -29,14 +28,18 @@ public void Given_valid_value_when_validating_it_should_return_success() const string testValue = "AD1200012030200359100100"; var country = new IbanCountry("AD") { - Iban = new PatternDescriptor(new TestPattern("AD2!n4!n4!n12!c", new SwiftPatternTokenizer())) + Iban = new PatternDescriptor(new TestPattern("AD2!n4!n4!n12!c", + [ + new PatternToken("AD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 12) + ])) }; // Act - ValidationRuleResult actual = _sut.Validate(new ValidationRuleContext(testValue) - { - Country = country - }); + ValidationRuleResult actual = _sut.Validate(new ValidationRuleContext(testValue) { Country = country }); // Assert actual.Should().Be(ValidationRuleResult.Success); @@ -53,14 +56,17 @@ public void Given_invalid_value_when_validating_it_should_return_error(string te { var country = new IbanCountry("NL") { - Iban = new PatternDescriptor(new TestPattern("NL2!n3!a", new SwiftPatternTokenizer())) + Iban = new PatternDescriptor(new TestPattern("NL2!n3!a", + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + + ])) }; // Act - ValidationRuleResult actual = _sut.Validate(new ValidationRuleContext(testValue) - { - Country = country - }); + ValidationRuleResult actual = _sut.Validate(new ValidationRuleContext(testValue) { Country = country }); // Assert actual.Should() From e4a76eca6db336b132b741da0f906e91e58548b4 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Tue, 30 Sep 2025 02:58:16 +0200 Subject: [PATCH 5/7] feat: generate WikipediaRegistryprovider using source generator instead of T4 --- src/IbanNet.CodeGen/IbanNet.CodeGen.csproj | 1 + .../RegistryProviderTransformGenerator.cs | 4 +- src/IbanNet.CodeGen/Wikipedia/Loader.cs | 9 +- .../Wikipedia/WikipediaDataSource.cs | 63 + src/IbanNet.CodeGen/Wikipedia/wiki.http | 7 - .../RegistrySourceAttribute.g.cs | 2 +- .../WikipediaRegistryProvider.g.cs | 8757 +++++++++++++++++ src/IbanNet/IbanNet.csproj | 13 +- .../Wikipedia/WikipediaPatternTokenizer.cs | 14 + .../Wikipedia/WikipediaRegistryProvider.cs | 915 +- .../Wikipedia/WikipediaRegistryProvider.tt | 100 - .../Wikipedia/api-result-1312145599.json | 1 + src/IbanNet/Registry/Wikipedia/wiki.http | 11 + 13 files changed, 8868 insertions(+), 1029 deletions(-) create mode 100644 src/IbanNet.CodeGen/Wikipedia/WikipediaDataSource.cs delete mode 100644 src/IbanNet.CodeGen/Wikipedia/wiki.http create mode 100644 src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/WikipediaRegistryProvider.g.cs delete mode 100644 src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.tt create mode 100644 src/IbanNet/Registry/Wikipedia/api-result-1312145599.json create mode 100644 src/IbanNet/Registry/Wikipedia/wiki.http diff --git a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj index d0760635..4e4f5efe 100644 --- a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj +++ b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj @@ -27,6 +27,7 @@ + diff --git a/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs b/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs index 0f6e7454..04398324 100644 --- a/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs +++ b/src/IbanNet.CodeGen/RegistryProviderTransformGenerator.cs @@ -4,6 +4,7 @@ using IbanNet.CodeGen.Liquid; using IbanNet.CodeGen.Swift; using IbanNet.CodeGen.Syntax; +using IbanNet.CodeGen.Wikipedia; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Text; @@ -15,7 +16,8 @@ public sealed class RegistryProviderTransformGenerator : IIncrementalGenerator { internal static readonly Dictionary DataSources = new() { - { "Swift", new SwiftDataSource() } + { "Swift", new SwiftDataSource() }, + { "Wikipedia", new WikipediaDataSource() } }; private static readonly List GeneratorNames = DataSources.Keys.ToList(); diff --git a/src/IbanNet.CodeGen/Wikipedia/Loader.cs b/src/IbanNet.CodeGen/Wikipedia/Loader.cs index c6e2b037..40f43898 100644 --- a/src/IbanNet.CodeGen/Wikipedia/Loader.cs +++ b/src/IbanNet.CodeGen/Wikipedia/Loader.cs @@ -21,9 +21,14 @@ public static WikiResult GetWikiData() "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36" ); using HttpResponseMessage response = httpClient.GetAsync(uri).GetAwaiter().GetResult(); - byte[] buffer = response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult(); + using Stream? stream = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult(); - WikiResponse? wikiResponse = JsonSerializer.Deserialize(buffer, JsonSerializerOptions); + return Read(stream); + } + + public static WikiResult Read(Stream stream) + { + WikiResponse? wikiResponse = JsonSerializer.Deserialize(stream, JsonSerializerOptions); if (wikiResponse is null) { throw new InvalidOperationException("Unexpected response."); diff --git a/src/IbanNet.CodeGen/Wikipedia/WikipediaDataSource.cs b/src/IbanNet.CodeGen/Wikipedia/WikipediaDataSource.cs new file mode 100644 index 00000000..fbab5da7 --- /dev/null +++ b/src/IbanNet.CodeGen/Wikipedia/WikipediaDataSource.cs @@ -0,0 +1,63 @@ +using System.Text; +using IbanNet.CodeGen.Swift; +using IbanNet.Registry.Patterns; + +namespace IbanNet.CodeGen.Wikipedia; + +internal sealed class WikipediaDataSource : IRegistryDataSource +{ + public bool IsDataSource(string path) + { + string? dir = Path.GetDirectoryName(path); + string? fn = Path.GetFileName(path); + string? ext = Path.GetExtension(fn); + return dir is not null + && fn is not null + && ext == ".json" + && fn.StartsWith("api-result-", StringComparison.InvariantCulture) + && dir.Contains("Wikipedia"); + } + + public SwiftCsvRecord[] GetCountryDefinitions(string text) + { + var tokenizer = new WikipediaPatternTokenizer(); + using var stream = new MemoryStream(Encoding.UTF8.GetBytes(text)); + WikiResult wikiData = Loader.Read(stream); + return wikiData.Records.Select(r => + { + int bbanLength = tokenizer.Tokenize(r.Pattern).Sum(t => t.MaxLength); + return new SwiftCsvRecord + { + CountryCode = r.CountryCode, + EnglishName = r.EnglishName, + Iban = new IbanCsvData + { + Pattern = r.Pattern, + Length = bbanLength + 4, + Tokenizer = new PrependCountryCodeWikipediaPatternTokenizer(r.CountryCode) + }, + Bban = new BbanCsvData + { + Pattern = r.Pattern, + Length = bbanLength, + Tokenizer = tokenizer + } + }; + }) + .ToArray(); + } + + private sealed class PrependCountryCodeWikipediaPatternTokenizer(string countryCode) : WikipediaPatternTokenizer + { + public override IEnumerable Tokenize(IEnumerable input) + { + yield return new PatternToken(countryCode); + yield return new PatternToken(AsciiCategory.Digit, 2); + + foreach (PatternToken token in base.Tokenize(input)) + { + yield return token; + } + } + } +} diff --git a/src/IbanNet.CodeGen/Wikipedia/wiki.http b/src/IbanNet.CodeGen/Wikipedia/wiki.http deleted file mode 100644 index f3750472..00000000 --- a/src/IbanNet.CodeGen/Wikipedia/wiki.http +++ /dev/null @@ -1,7 +0,0 @@ -GET https://en.wikipedia.org/w/api.php?format=json&action=parse&page=International_Bank_Account_Number§ion=16 -User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 - -### - -GET https://en.wikipedia.org/api/rest_v1/page/html/International_Bank_Account_Number -User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 diff --git a/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs index ff96991e..3d9fa3e1 100644 --- a/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs +++ b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/RegistrySourceAttribute.g.cs @@ -6,7 +6,7 @@ namespace IbanNet.CodeGen; internal enum RegistrySource { - Swift + Swift, Wikipedia } [global::System.AttributeUsage(global::System.AttributeTargets.Method, Inherited = true, AllowMultiple = false)] diff --git a/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/WikipediaRegistryProvider.g.cs b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/WikipediaRegistryProvider.g.cs new file mode 100644 index 00000000..3f6bb77b --- /dev/null +++ b/src/IbanNet/Generated/IbanNet.CodeGen/IbanNet.CodeGen.RegistryProviderTransformGenerator/WikipediaRegistryProvider.g.cs @@ -0,0 +1,8757 @@ +// + +#nullable enable + +using System.CodeDom.Compiler; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using IbanNet.Extensions; +using IbanNet.Registry.Patterns; + +namespace IbanNet.Registry.Wikipedia; + +/// +/// Nr. of countries: 110 +/// +partial class WikipediaRegistryProvider +{ + /// + /// Generated from: api-result-1312145599.json
+ ///
+ [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + private static partial IEnumerable Load() + { + // ReSharper disable CommentTypo + // ReSharper disable StringLiteralTypo + + // Andorra + yield return new IbanCountry("AD") + { + NativeName = "Andorra", + EnglishName = "Andorra", + Iban = new PatternDescriptor(Patterns.AD.Iban), + Bban = new PatternDescriptor(Patterns.AD.Bban, 4), + }; + + // United Arab Emirates + yield return new IbanCountry("AE") + { + NativeName = "الإمارات العربية المتحدة", + EnglishName = "United Arab Emirates", + Iban = new PatternDescriptor(Patterns.AE.Iban), + Bban = new PatternDescriptor(Patterns.AE.Bban, 4), + }; + + // Albania + yield return new IbanCountry("AL") + { + NativeName = "Shqipëri", + EnglishName = "Albania", + Iban = new PatternDescriptor(Patterns.AL.Iban), + Bban = new PatternDescriptor(Patterns.AL.Bban, 4), + }; + + // Angola + yield return new IbanCountry("AO") + { + NativeName = "Angóla", + EnglishName = "Angola", + Iban = new PatternDescriptor(Patterns.AO.Iban), + Bban = new PatternDescriptor(Patterns.AO.Bban, 4), + }; + + // Austria + yield return new IbanCountry("AT") + { + NativeName = "Österreich", + EnglishName = "Austria", + Iban = new PatternDescriptor(Patterns.AT.Iban), + Bban = new PatternDescriptor(Patterns.AT.Bban, 4), + }; + + // Azerbaijan + yield return new IbanCountry("AZ") + { + NativeName = "Азәрбајҹан", + EnglishName = "Azerbaijan", + Iban = new PatternDescriptor(Patterns.AZ.Iban), + Bban = new PatternDescriptor(Patterns.AZ.Bban, 4), + }; + + // Bosnia and Herzegovina + yield return new IbanCountry("BA") + { + NativeName = "Bosna i Hercegovina", + EnglishName = "Bosnia and Herzegovina", + Iban = new PatternDescriptor(Patterns.BA.Iban), + Bban = new PatternDescriptor(Patterns.BA.Bban, 4), + }; + + // Belgium + yield return new IbanCountry("BE") + { + NativeName = "België", + EnglishName = "Belgium", + Iban = new PatternDescriptor(Patterns.BE.Iban), + Bban = new PatternDescriptor(Patterns.BE.Bban, 4), + }; + + // Burkina Faso + yield return new IbanCountry("BF") + { + NativeName = "Burkibaa Faaso", + EnglishName = "Burkina Faso", + Iban = new PatternDescriptor(Patterns.BF.Iban), + Bban = new PatternDescriptor(Patterns.BF.Bban, 4), + }; + + // Bulgaria + yield return new IbanCountry("BG") + { + NativeName = "България", + EnglishName = "Bulgaria", + Iban = new PatternDescriptor(Patterns.BG.Iban), + Bban = new PatternDescriptor(Patterns.BG.Bban, 4), + }; + + // Bahrain + yield return new IbanCountry("BH") + { + NativeName = "البحرين", + EnglishName = "Bahrain", + Iban = new PatternDescriptor(Patterns.BH.Iban), + Bban = new PatternDescriptor(Patterns.BH.Bban, 4), + }; + + // Burundi + yield return new IbanCountry("BI") + { + NativeName = "Burundi", + EnglishName = "Burundi", + Iban = new PatternDescriptor(Patterns.BI.Iban), + Bban = new PatternDescriptor(Patterns.BI.Bban, 4), + }; + + // Benin + yield return new IbanCountry("BJ") + { + NativeName = "Bénin", + EnglishName = "Benin", + Iban = new PatternDescriptor(Patterns.BJ.Iban), + Bban = new PatternDescriptor(Patterns.BJ.Bban, 4), + }; + + // Brazil + yield return new IbanCountry("BR") + { + NativeName = "Brasil", + EnglishName = "Brazil", + Iban = new PatternDescriptor(Patterns.BR.Iban), + Bban = new PatternDescriptor(Patterns.BR.Bban, 4), + }; + + // Belarus + yield return new IbanCountry("BY") + { + NativeName = "Беларусь", + EnglishName = "Belarus", + Iban = new PatternDescriptor(Patterns.BY.Iban), + Bban = new PatternDescriptor(Patterns.BY.Bban, 4), + }; + + // Central African Republic + yield return new IbanCountry("CF") + { + NativeName = "République centrafricaine", + EnglishName = "Central African Republic", + Iban = new PatternDescriptor(Patterns.CF.Iban), + Bban = new PatternDescriptor(Patterns.CF.Bban, 4), + }; + + // Congo, Republic of the + yield return new IbanCountry("CG") + { + NativeName = "Congo", + EnglishName = "Congo, Republic of the", + Iban = new PatternDescriptor(Patterns.CG.Iban), + Bban = new PatternDescriptor(Patterns.CG.Bban, 4), + }; + + // Switzerland + yield return new IbanCountry("CH") + { + NativeName = "Svizzera", + EnglishName = "Switzerland", + Iban = new PatternDescriptor(Patterns.CH.Iban), + Bban = new PatternDescriptor(Patterns.CH.Bban, 4), + }; + + // Côte d'Ivoire + yield return new IbanCountry("CI") + { + NativeName = "Côte d’Ivoire", + EnglishName = "Côte d'Ivoire", + Iban = new PatternDescriptor(Patterns.CI.Iban), + Bban = new PatternDescriptor(Patterns.CI.Bban, 4), + }; + + // Cameroon + yield return new IbanCountry("CM") + { + NativeName = "Kàmàlûŋ", + EnglishName = "Cameroon", + Iban = new PatternDescriptor(Patterns.CM.Iban), + Bban = new PatternDescriptor(Patterns.CM.Bban, 4), + }; + + // Costa Rica + yield return new IbanCountry("CR") + { + NativeName = "Costa Rica", + EnglishName = "Costa Rica", + Iban = new PatternDescriptor(Patterns.CR.Iban), + Bban = new PatternDescriptor(Patterns.CR.Bban, 4), + }; + + // Cabo Verde + yield return new IbanCountry("CV") + { + NativeName = "Kabu Verdi", + EnglishName = "Cabo Verde", + Iban = new PatternDescriptor(Patterns.CV.Iban), + Bban = new PatternDescriptor(Patterns.CV.Bban, 4), + }; + + // Cyprus + yield return new IbanCountry("CY") + { + NativeName = "Κύπρος", + EnglishName = "Cyprus", + Iban = new PatternDescriptor(Patterns.CY.Iban), + Bban = new PatternDescriptor(Patterns.CY.Bban, 4), + }; + + // Czech Republic + yield return new IbanCountry("CZ") + { + NativeName = "Česko", + EnglishName = "Czech Republic", + Iban = new PatternDescriptor(Patterns.CZ.Iban), + Bban = new PatternDescriptor(Patterns.CZ.Bban, 4), + }; + + // Germany + yield return new IbanCountry("DE") + { + NativeName = "Deutschland", + EnglishName = "Germany", + Iban = new PatternDescriptor(Patterns.DE.Iban), + Bban = new PatternDescriptor(Patterns.DE.Bban, 4), + }; + + // Djibouti + yield return new IbanCountry("DJ") + { + NativeName = "Yabuuti", + EnglishName = "Djibouti", + Iban = new PatternDescriptor(Patterns.DJ.Iban), + Bban = new PatternDescriptor(Patterns.DJ.Bban, 4), + }; + + // Denmark + yield return new IbanCountry("DK") + { + NativeName = "Danmark", + EnglishName = "Denmark", + Iban = new PatternDescriptor(Patterns.DK.Iban), + Bban = new PatternDescriptor(Patterns.DK.Bban, 4), + }; + + // Dominican Republic + yield return new IbanCountry("DO") + { + NativeName = "República Dominicana", + EnglishName = "Dominican Republic", + Iban = new PatternDescriptor(Patterns.DO.Iban), + Bban = new PatternDescriptor(Patterns.DO.Bban, 4), + }; + + // Algeria + yield return new IbanCountry("DZ") + { + NativeName = "الجزائر", + EnglishName = "Algeria", + Iban = new PatternDescriptor(Patterns.DZ.Iban), + Bban = new PatternDescriptor(Patterns.DZ.Bban, 4), + }; + + // Estonia + yield return new IbanCountry("EE") + { + NativeName = "Eesti", + EnglishName = "Estonia", + Iban = new PatternDescriptor(Patterns.EE.Iban), + Bban = new PatternDescriptor(Patterns.EE.Bban, 4), + }; + + // Egypt + yield return new IbanCountry("EG") + { + NativeName = "مصر", + EnglishName = "Egypt", + Iban = new PatternDescriptor(Patterns.EG.Iban), + Bban = new PatternDescriptor(Patterns.EG.Bban, 4), + }; + + // Spain + yield return new IbanCountry("ES") + { + NativeName = "España", + EnglishName = "Spain", + Iban = new PatternDescriptor(Patterns.ES.Iban), + Bban = new PatternDescriptor(Patterns.ES.Bban, 4), + }; + + // Finland + yield return new IbanCountry("FI") + { + NativeName = "Suomi", + EnglishName = "Finland", + Iban = new PatternDescriptor(Patterns.FI.Iban), + Bban = new PatternDescriptor(Patterns.FI.Bban, 4), + }; + + // Falkland Islands + yield return new IbanCountry("FK") + { + NativeName = "Falkland Islands", + EnglishName = "Falkland Islands", + Iban = new PatternDescriptor(Patterns.FK.Iban), + Bban = new PatternDescriptor(Patterns.FK.Bban, 4), + }; + + // Faroe Islands + yield return new IbanCountry("FO") + { + NativeName = "Føroyar", + EnglishName = "Faroe Islands", + Iban = new PatternDescriptor(Patterns.FO.Iban), + Bban = new PatternDescriptor(Patterns.FO.Bban, 4), + }; + + // France + yield return new IbanCountry("FR") + { + NativeName = "France", + EnglishName = "France", + Iban = new PatternDescriptor(Patterns.FR.Iban), + Bban = new PatternDescriptor(Patterns.FR.Bban, 4), + }; + + // Gabon + yield return new IbanCountry("GA") + { + NativeName = "Gabon", + EnglishName = "Gabon", + Iban = new PatternDescriptor(Patterns.GA.Iban), + Bban = new PatternDescriptor(Patterns.GA.Bban, 4), + }; + + // United Kingdom + yield return new IbanCountry("GB") + { + NativeName = "United Kingdom", + EnglishName = "United Kingdom", + Iban = new PatternDescriptor(Patterns.GB.Iban), + Bban = new PatternDescriptor(Patterns.GB.Bban, 4), + }; + + // Georgia + yield return new IbanCountry("GE") + { + NativeName = "საქართველო", + EnglishName = "Georgia", + Iban = new PatternDescriptor(Patterns.GE.Iban), + Bban = new PatternDescriptor(Patterns.GE.Bban, 4), + }; + + // Gibraltar + yield return new IbanCountry("GI") + { + NativeName = "Gibraltar", + EnglishName = "Gibraltar", + Iban = new PatternDescriptor(Patterns.GI.Iban), + Bban = new PatternDescriptor(Patterns.GI.Bban, 4), + }; + + // Greenland + yield return new IbanCountry("GL") + { + NativeName = "Kalaallit Nunaat", + EnglishName = "Greenland", + Iban = new PatternDescriptor(Patterns.GL.Iban), + Bban = new PatternDescriptor(Patterns.GL.Bban, 4), + }; + + // Equatorial Guinea + yield return new IbanCountry("GQ") + { + NativeName = "Guinea Ecuatorial", + EnglishName = "Equatorial Guinea", + Iban = new PatternDescriptor(Patterns.GQ.Iban), + Bban = new PatternDescriptor(Patterns.GQ.Bban, 4), + }; + + // Greece + yield return new IbanCountry("GR") + { + NativeName = "Ελλάδα", + EnglishName = "Greece", + Iban = new PatternDescriptor(Patterns.GR.Iban), + Bban = new PatternDescriptor(Patterns.GR.Bban, 4), + }; + + // Guatemala + yield return new IbanCountry("GT") + { + NativeName = "Guatemala", + EnglishName = "Guatemala", + Iban = new PatternDescriptor(Patterns.GT.Iban), + Bban = new PatternDescriptor(Patterns.GT.Bban, 4), + }; + + // Guinea-Bissau + yield return new IbanCountry("GW") + { + NativeName = "Gine-Bisaawo", + EnglishName = "Guinea-Bissau", + Iban = new PatternDescriptor(Patterns.GW.Iban), + Bban = new PatternDescriptor(Patterns.GW.Bban, 4), + }; + + // Honduras + yield return new IbanCountry("HN") + { + NativeName = "Honduras", + EnglishName = "Honduras", + Iban = new PatternDescriptor(Patterns.HN.Iban), + Bban = new PatternDescriptor(Patterns.HN.Bban, 4), + }; + + // Croatia + yield return new IbanCountry("HR") + { + NativeName = "Hrvatska", + EnglishName = "Croatia", + Iban = new PatternDescriptor(Patterns.HR.Iban), + Bban = new PatternDescriptor(Patterns.HR.Bban, 4), + }; + + // Hungary + yield return new IbanCountry("HU") + { + NativeName = "Magyarország", + EnglishName = "Hungary", + Iban = new PatternDescriptor(Patterns.HU.Iban), + Bban = new PatternDescriptor(Patterns.HU.Bban, 4), + }; + + // Ireland + yield return new IbanCountry("IE") + { + NativeName = "Ireland", + EnglishName = "Ireland", + Iban = new PatternDescriptor(Patterns.IE.Iban), + Bban = new PatternDescriptor(Patterns.IE.Bban, 4), + }; + + // Israel + yield return new IbanCountry("IL") + { + NativeName = "ישראל", + EnglishName = "Israel", + Iban = new PatternDescriptor(Patterns.IL.Iban), + Bban = new PatternDescriptor(Patterns.IL.Bban, 4), + }; + + // Iraq + yield return new IbanCountry("IQ") + { + NativeName = "العراق", + EnglishName = "Iraq", + Iban = new PatternDescriptor(Patterns.IQ.Iban), + Bban = new PatternDescriptor(Patterns.IQ.Bban, 4), + }; + + // Iran + yield return new IbanCountry("IR") + { + NativeName = "ایران", + EnglishName = "Iran", + Iban = new PatternDescriptor(Patterns.IR.Iban), + Bban = new PatternDescriptor(Patterns.IR.Bban, 4), + }; + + // Iceland + yield return new IbanCountry("IS") + { + NativeName = "Ísland", + EnglishName = "Iceland", + Iban = new PatternDescriptor(Patterns.IS.Iban), + Bban = new PatternDescriptor(Patterns.IS.Bban, 4), + }; + + // Italy + yield return new IbanCountry("IT") + { + NativeName = "Italia", + EnglishName = "Italy", + Iban = new PatternDescriptor(Patterns.IT.Iban), + Bban = new PatternDescriptor(Patterns.IT.Bban, 4), + }; + + // Jordan + yield return new IbanCountry("JO") + { + NativeName = "الأردن", + EnglishName = "Jordan", + Iban = new PatternDescriptor(Patterns.JO.Iban), + Bban = new PatternDescriptor(Patterns.JO.Bban, 4), + }; + + // Comoros + yield return new IbanCountry("KM") + { + NativeName = "جزر القمر", + EnglishName = "Comoros", + Iban = new PatternDescriptor(Patterns.KM.Iban), + Bban = new PatternDescriptor(Patterns.KM.Bban, 4), + }; + + // Kuwait + yield return new IbanCountry("KW") + { + NativeName = "الكويت", + EnglishName = "Kuwait", + Iban = new PatternDescriptor(Patterns.KW.Iban), + Bban = new PatternDescriptor(Patterns.KW.Bban, 4), + }; + + // Kazakhstan + yield return new IbanCountry("KZ") + { + NativeName = "Қазақстан", + EnglishName = "Kazakhstan", + Iban = new PatternDescriptor(Patterns.KZ.Iban), + Bban = new PatternDescriptor(Patterns.KZ.Bban, 4), + }; + + // Lebanon + yield return new IbanCountry("LB") + { + NativeName = "لبنان", + EnglishName = "Lebanon", + Iban = new PatternDescriptor(Patterns.LB.Iban), + Bban = new PatternDescriptor(Patterns.LB.Bban, 4), + }; + + // Saint Lucia + yield return new IbanCountry("LC") + { + NativeName = "St. Lucia", + EnglishName = "Saint Lucia", + Iban = new PatternDescriptor(Patterns.LC.Iban), + Bban = new PatternDescriptor(Patterns.LC.Bban, 4), + }; + + // Liechtenstein + yield return new IbanCountry("LI") + { + NativeName = "Liechtenstein", + EnglishName = "Liechtenstein", + Iban = new PatternDescriptor(Patterns.LI.Iban), + Bban = new PatternDescriptor(Patterns.LI.Bban, 4), + }; + + // Lithuania + yield return new IbanCountry("LT") + { + NativeName = "Lietuva", + EnglishName = "Lithuania", + Iban = new PatternDescriptor(Patterns.LT.Iban), + Bban = new PatternDescriptor(Patterns.LT.Bban, 4), + }; + + // Luxembourg + yield return new IbanCountry("LU") + { + NativeName = "Lëtzebuerg", + EnglishName = "Luxembourg", + Iban = new PatternDescriptor(Patterns.LU.Iban), + Bban = new PatternDescriptor(Patterns.LU.Bban, 4), + }; + + // Latvia + yield return new IbanCountry("LV") + { + NativeName = "Latvija", + EnglishName = "Latvia", + Iban = new PatternDescriptor(Patterns.LV.Iban), + Bban = new PatternDescriptor(Patterns.LV.Bban, 4), + }; + + // Libya + yield return new IbanCountry("LY") + { + NativeName = "ليبيا", + EnglishName = "Libya", + Iban = new PatternDescriptor(Patterns.LY.Iban), + Bban = new PatternDescriptor(Patterns.LY.Bban, 4), + }; + + // Morocco + yield return new IbanCountry("MA") + { + NativeName = "المملكة المغربية", + EnglishName = "Morocco", + Iban = new PatternDescriptor(Patterns.MA.Iban), + Bban = new PatternDescriptor(Patterns.MA.Bban, 4), + }; + + // Monaco + yield return new IbanCountry("MC") + { + NativeName = "Monaco", + EnglishName = "Monaco", + Iban = new PatternDescriptor(Patterns.MC.Iban), + Bban = new PatternDescriptor(Patterns.MC.Bban, 4), + }; + + // Moldova + yield return new IbanCountry("MD") + { + NativeName = "Republica Moldova", + EnglishName = "Moldova", + Iban = new PatternDescriptor(Patterns.MD.Iban), + Bban = new PatternDescriptor(Patterns.MD.Bban, 4), + }; + + // Montenegro + yield return new IbanCountry("ME") + { + NativeName = "Crna Gora", + EnglishName = "Montenegro", + Iban = new PatternDescriptor(Patterns.ME.Iban), + Bban = new PatternDescriptor(Patterns.ME.Bban, 4), + }; + + // Madagascar + yield return new IbanCountry("MG") + { + NativeName = "Madagascar", + EnglishName = "Madagascar", + Iban = new PatternDescriptor(Patterns.MG.Iban), + Bban = new PatternDescriptor(Patterns.MG.Bban, 4), + }; + + // North Macedonia + yield return new IbanCountry("MK") + { + NativeName = "Северна Македонија", + EnglishName = "North Macedonia", + Iban = new PatternDescriptor(Patterns.MK.Iban), + Bban = new PatternDescriptor(Patterns.MK.Bban, 4), + }; + + // Mali + yield return new IbanCountry("ML") + { + NativeName = "Mali", + EnglishName = "Mali", + Iban = new PatternDescriptor(Patterns.ML.Iban), + Bban = new PatternDescriptor(Patterns.ML.Bban, 4), + }; + + // Mongolia + yield return new IbanCountry("MN") + { + NativeName = "Монгол", + EnglishName = "Mongolia", + Iban = new PatternDescriptor(Patterns.MN.Iban), + Bban = new PatternDescriptor(Patterns.MN.Bban, 4), + }; + + // Mauritania + yield return new IbanCountry("MR") + { + NativeName = "موريتانيا", + EnglishName = "Mauritania", + Iban = new PatternDescriptor(Patterns.MR.Iban), + Bban = new PatternDescriptor(Patterns.MR.Bban, 4), + }; + + // Malta + yield return new IbanCountry("MT") + { + NativeName = "Malta", + EnglishName = "Malta", + Iban = new PatternDescriptor(Patterns.MT.Iban), + Bban = new PatternDescriptor(Patterns.MT.Bban, 4), + }; + + // Mauritius + yield return new IbanCountry("MU") + { + NativeName = "Mauritius", + EnglishName = "Mauritius", + Iban = new PatternDescriptor(Patterns.MU.Iban), + Bban = new PatternDescriptor(Patterns.MU.Bban, 4), + }; + + // Mozambique + yield return new IbanCountry("MZ") + { + NativeName = "Umozambiki", + EnglishName = "Mozambique", + Iban = new PatternDescriptor(Patterns.MZ.Iban), + Bban = new PatternDescriptor(Patterns.MZ.Bban, 4), + }; + + // Niger + yield return new IbanCountry("NE") + { + NativeName = "Nižer", + EnglishName = "Niger", + Iban = new PatternDescriptor(Patterns.NE.Iban), + Bban = new PatternDescriptor(Patterns.NE.Bban, 4), + }; + + // Nicaragua + yield return new IbanCountry("NI") + { + NativeName = "Nicaragua", + EnglishName = "Nicaragua", + Iban = new PatternDescriptor(Patterns.NI.Iban), + Bban = new PatternDescriptor(Patterns.NI.Bban, 4), + }; + + // Netherlands + yield return new IbanCountry("NL") + { + NativeName = "Nederland", + EnglishName = "Netherlands", + Iban = new PatternDescriptor(Patterns.NL.Iban), + Bban = new PatternDescriptor(Patterns.NL.Bban, 4), + }; + + // Norway + yield return new IbanCountry("NO") + { + NativeName = "Noreg", + EnglishName = "Norway", + Iban = new PatternDescriptor(Patterns.NO.Iban), + Bban = new PatternDescriptor(Patterns.NO.Bban, 4), + }; + + // Oman + yield return new IbanCountry("OM") + { + NativeName = "عمان", + EnglishName = "Oman", + Iban = new PatternDescriptor(Patterns.OM.Iban), + Bban = new PatternDescriptor(Patterns.OM.Bban, 4), + }; + + // Pakistan + yield return new IbanCountry("PK") + { + NativeName = "پاکستان", + EnglishName = "Pakistan", + Iban = new PatternDescriptor(Patterns.PK.Iban), + Bban = new PatternDescriptor(Patterns.PK.Bban, 4), + }; + + // Poland + yield return new IbanCountry("PL") + { + NativeName = "Polska", + EnglishName = "Poland", + Iban = new PatternDescriptor(Patterns.PL.Iban), + Bban = new PatternDescriptor(Patterns.PL.Bban, 4), + }; + + // Palestinian territories + yield return new IbanCountry("PS") + { + NativeName = "السلطة الفلسطينية", + EnglishName = "Palestinian territories", + Iban = new PatternDescriptor(Patterns.PS.Iban), + Bban = new PatternDescriptor(Patterns.PS.Bban, 4), + }; + + // Portugal + yield return new IbanCountry("PT") + { + NativeName = "Portugal", + EnglishName = "Portugal", + Iban = new PatternDescriptor(Patterns.PT.Iban), + Bban = new PatternDescriptor(Patterns.PT.Bban, 4), + }; + + // Qatar + yield return new IbanCountry("QA") + { + NativeName = "قطر", + EnglishName = "Qatar", + Iban = new PatternDescriptor(Patterns.QA.Iban), + Bban = new PatternDescriptor(Patterns.QA.Bban, 4), + }; + + // Romania + yield return new IbanCountry("RO") + { + NativeName = "România", + EnglishName = "Romania", + Iban = new PatternDescriptor(Patterns.RO.Iban), + Bban = new PatternDescriptor(Patterns.RO.Bban, 4), + }; + + // Serbia + yield return new IbanCountry("RS") + { + NativeName = "Srbija", + EnglishName = "Serbia", + Iban = new PatternDescriptor(Patterns.RS.Iban), + Bban = new PatternDescriptor(Patterns.RS.Bban, 4), + }; + + // Saudi Arabia + yield return new IbanCountry("SA") + { + NativeName = "المملكة العربية السعودية", + EnglishName = "Saudi Arabia", + Iban = new PatternDescriptor(Patterns.SA.Iban), + Bban = new PatternDescriptor(Patterns.SA.Bban, 4), + }; + + // Seychelles + yield return new IbanCountry("SC") + { + NativeName = "Seychelles", + EnglishName = "Seychelles", + Iban = new PatternDescriptor(Patterns.SC.Iban), + Bban = new PatternDescriptor(Patterns.SC.Bban, 4), + }; + + // Sudan + yield return new IbanCountry("SD") + { + NativeName = "السودان", + EnglishName = "Sudan", + Iban = new PatternDescriptor(Patterns.SD.Iban), + Bban = new PatternDescriptor(Patterns.SD.Bban, 4), + }; + + // Sweden + yield return new IbanCountry("SE") + { + NativeName = "Sverige", + EnglishName = "Sweden", + Iban = new PatternDescriptor(Patterns.SE.Iban), + Bban = new PatternDescriptor(Patterns.SE.Bban, 4), + }; + + // Slovenia + yield return new IbanCountry("SI") + { + NativeName = "Slovenija", + EnglishName = "Slovenia", + Iban = new PatternDescriptor(Patterns.SI.Iban), + Bban = new PatternDescriptor(Patterns.SI.Bban, 4), + }; + + // Slovakia + yield return new IbanCountry("SK") + { + NativeName = "Slovensko", + EnglishName = "Slovakia", + Iban = new PatternDescriptor(Patterns.SK.Iban), + Bban = new PatternDescriptor(Patterns.SK.Bban, 4), + }; + + // San Marino + yield return new IbanCountry("SM") + { + NativeName = "San Marino", + EnglishName = "San Marino", + Iban = new PatternDescriptor(Patterns.SM.Iban), + Bban = new PatternDescriptor(Patterns.SM.Bban, 4), + }; + + // Senegal + yield return new IbanCountry("SN") + { + NativeName = "Senegaal", + EnglishName = "Senegal", + Iban = new PatternDescriptor(Patterns.SN.Iban), + Bban = new PatternDescriptor(Patterns.SN.Bban, 4), + }; + + // Somalia + yield return new IbanCountry("SO") + { + NativeName = "الصومال", + EnglishName = "Somalia", + Iban = new PatternDescriptor(Patterns.SO.Iban), + Bban = new PatternDescriptor(Patterns.SO.Bban, 4), + }; + + // São Tomé and Príncipe + yield return new IbanCountry("ST") + { + NativeName = "São Tomé e Príncipe", + EnglishName = "São Tomé and Príncipe", + Iban = new PatternDescriptor(Patterns.ST.Iban), + Bban = new PatternDescriptor(Patterns.ST.Bban, 4), + }; + + // El Salvador + yield return new IbanCountry("SV") + { + NativeName = "El Salvador", + EnglishName = "El Salvador", + Iban = new PatternDescriptor(Patterns.SV.Iban), + Bban = new PatternDescriptor(Patterns.SV.Bban, 4), + }; + + // Chad + yield return new IbanCountry("TD") + { + NativeName = "تشاد", + EnglishName = "Chad", + Iban = new PatternDescriptor(Patterns.TD.Iban), + Bban = new PatternDescriptor(Patterns.TD.Bban, 4), + }; + + // Togo + yield return new IbanCountry("TG") + { + NativeName = "Togo nutome", + EnglishName = "Togo", + Iban = new PatternDescriptor(Patterns.TG.Iban), + Bban = new PatternDescriptor(Patterns.TG.Bban, 4), + }; + + // East Timor + yield return new IbanCountry("TL") + { + NativeName = "Timor-Leste", + EnglishName = "East Timor", + Iban = new PatternDescriptor(Patterns.TL.Iban), + Bban = new PatternDescriptor(Patterns.TL.Bban, 4), + }; + + // Tunisia + yield return new IbanCountry("TN") + { + NativeName = "تونس", + EnglishName = "Tunisia", + Iban = new PatternDescriptor(Patterns.TN.Iban), + Bban = new PatternDescriptor(Patterns.TN.Bban, 4), + }; + + // Turkey + yield return new IbanCountry("TR") + { + NativeName = "Türkiye", + EnglishName = "Turkey", + Iban = new PatternDescriptor(Patterns.TR.Iban), + Bban = new PatternDescriptor(Patterns.TR.Bban, 4), + }; + + // Ukraine + yield return new IbanCountry("UA") + { + NativeName = "Україна", + EnglishName = "Ukraine", + Iban = new PatternDescriptor(Patterns.UA.Iban), + Bban = new PatternDescriptor(Patterns.UA.Bban, 4), + }; + + // Vatican City + yield return new IbanCountry("VA") + { + NativeName = "Città del Vaticano", + EnglishName = "Vatican City", + Iban = new PatternDescriptor(Patterns.VA.Iban), + Bban = new PatternDescriptor(Patterns.VA.Bban, 4), + }; + + // Virgin Islands, British + yield return new IbanCountry("VG") + { + NativeName = "British Virgin Islands", + EnglishName = "Virgin Islands, British", + Iban = new PatternDescriptor(Patterns.VG.Iban), + Bban = new PatternDescriptor(Patterns.VG.Bban, 4), + }; + + // Kosovo + yield return new IbanCountry("XK") + { + NativeName = "Kosovë", + EnglishName = "Kosovo", + Iban = new PatternDescriptor(Patterns.XK.Iban), + Bban = new PatternDescriptor(Patterns.XK.Bban, 4), + }; + + // Yemen + yield return new IbanCountry("YE") + { + NativeName = "اليمن", + EnglishName = "Yemen", + Iban = new PatternDescriptor(Patterns.YE.Iban), + Bban = new PatternDescriptor(Patterns.YE.Bban, 4), + }; + + // ReSharper restore StringLiteralTypo + // ReSharper restore CommentTypo + } + + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + private static class Patterns + { + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal class Pattern : IbanNet.Registry.Patterns.Pattern + { + public Pattern(string pattern, int maxLength, bool isFixedLength, PatternToken[] tokens) + : base(pattern, maxLength, isFixedLength, tokens) + { + } + } + + // Andorra + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("8n,12c", 24, true, + [ + new PatternToken("AD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8n,12c", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + + } + + // United Arab Emirates + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,16n", 23, true, + [ + new PatternToken("AE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,16n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Albania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("8n,16c", 28, true, + [ + new PatternToken("AL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8n,16c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Angola + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("AO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // Austria + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("16n", 20, true, + [ + new PatternToken("AT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("16n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Azerbaijan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class AZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,20c", 28, true, + [ + new PatternToken("AZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'A' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,20c", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + + } + + // Bosnia and Herzegovina + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("16n", 20, true, + [ + new PatternToken("BA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("16n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Belgium + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("12n", 16, true, + [ + new PatternToken("BE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("12n", 12, true, + [ + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + + } + + // Burkina Faso + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BF + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2c,22n", 28, true, + [ + new PatternToken("BF"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'F' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2c,22n", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Bulgaria + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,6n,8c", 22, true, + [ + new PatternToken("BG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 8), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,6n,8c", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 8), + ] + ); + + + } + + // Bahrain + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BH + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,14c", 22, true, + [ + new PatternToken("BH"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'H' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,14c", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 14), + ] + ); + + + } + + // Burundi + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("5n,5n,11n,2n", 27, true, + [ + new PatternToken("BI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5n,5n,11n,2n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Benin + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BJ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2c,22n", 28, true, + [ + new PatternToken("BJ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'J' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2c,22n", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Brazil + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n,1a,1c", 29, true, + [ + new PatternToken("BR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 1), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n,1a,1c", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 1), + ] + ); + + + } + + // Belarus + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class BY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4c,4n,16c", 28, true, + [ + new PatternToken("BY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'B' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4c,4n,16c", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Central African Republic + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CF + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("CF"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'F' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Congo, Republic of the + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("CG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Switzerland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CH + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("5n,12c", 21, true, + [ + new PatternToken("CH"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'H' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5n,12c", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + + } + + // Côte d'Ivoire + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,22n", 28, true, + [ + new PatternToken("CI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,22n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Cameroon + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("CM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Costa Rica + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("18n", 22, true, + [ + new PatternToken("CR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("18n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 18), + ] + ); + + + } + + // Cabo Verde + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CV + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("CV"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'V' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // Cyprus + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("8n,16c", 28, true, + [ + new PatternToken("CY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("8n,16c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 8), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Czech Republic + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class CZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("20n", 24, true, + [ + new PatternToken("CZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'C' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("20n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Germany + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("18n", 22, true, + [ + new PatternToken("DE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("18n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 18), + ] + ); + + + } + + // Djibouti + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DJ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("5n,5n,11n,2n", 27, true, + [ + new PatternToken("DJ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'J' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5n,5n,11n,2n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Denmark + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("14n", 18, true, + [ + new PatternToken("DK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("14n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // Dominican Republic + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4c,20n", 28, true, + [ + new PatternToken("DO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4c,20n", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Algeria + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class DZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("22n", 26, true, + [ + new PatternToken("DZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'D' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("22n", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Estonia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class EE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("16n", 20, true, + [ + new PatternToken("EE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("16n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Egypt + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class EG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("25n", 29, true, + [ + new PatternToken("EG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 25), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("25n", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 25), + ] + ); + + + } + + // Spain + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ES + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("20n", 24, true, + [ + new PatternToken("ES"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'E' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("20n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Finland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("14n", 18, true, + [ + new PatternToken("FI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("14n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // Falkland Islands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,12n", 18, true, + [ + new PatternToken("FK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,12n", 14, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + + } + + // Faroe Islands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("14n", 18, true, + [ + new PatternToken("FO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("14n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // France + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class FR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("10n,11c,2n", 27, true, + [ + new PatternToken("FR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'F' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("10n,11c,2n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Gabon + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("GA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // United Kingdom + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GB + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,14n", 22, true, + [ + new PatternToken("GB"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'B' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,14n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // Georgia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,16n", 22, true, + [ + new PatternToken("GE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,16n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Gibraltar + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,15c", 23, true, + [ + new PatternToken("GI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,15c", 19, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 15), + ] + ); + + + } + + // Greenland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("14n", 18, true, + [ + new PatternToken("GL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("14n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // Equatorial Guinea + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GQ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("GQ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'Q' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Greece + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("7n,16c", 27, true, + [ + new PatternToken("GR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("7n,16c", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 7), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Guatemala + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4c,20c", 28, true, + [ + new PatternToken("GT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4c,20c", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + + } + + // Guinea-Bissau + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class GW + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2c,19n", 25, true, + [ + new PatternToken("GW"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 19), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'G' + && value[pos++] == 'W' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2c,19n", 21, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 19), + ] + ); + + + } + + // Honduras + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,20n", 28, true, + [ + new PatternToken("HN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,20n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Croatia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("17n", 21, true, + [ + new PatternToken("HR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 17), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("17n", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 17), + ] + ); + + + } + + // Hungary + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class HU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("24n", 28, true, + [ + new PatternToken("HU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 24), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'H' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("24n", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 24), + ] + ); + + + } + + // Ireland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,6n,8n", 22, true, + [ + new PatternToken("IE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,6n,8n", 18, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.Digit, 8), + ] + ); + + + } + + // Israel + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("19n", 23, true, + [ + new PatternToken("IL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 19), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("19n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 19), + ] + ); + + + } + + // Iraq + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IQ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,15n", 23, true, + [ + new PatternToken("IQ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'Q' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,15n", 19, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 15), + ] + ); + + + } + + // Iran + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("22n", 26, true, + [ + new PatternToken("IR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("22n", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Iceland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("22n", 26, true, + [ + new PatternToken("IS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("22n", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Italy + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class IT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("1a,10n,12c", 27, true, + [ + new PatternToken("IT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'I' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("1a,10n,12c", 23, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + + } + + // Jordan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class JO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,4n,18c", 30, true, + [ + new PatternToken("JO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'J' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,4n,18c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + + } + + // Comoros + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class KM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("KM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'K' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Kuwait + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class KW + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,22c", 30, true, + [ + new PatternToken("KW"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'K' + && value[pos++] == 'W' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,22c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 22), + ] + ); + + + } + + // Kazakhstan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class KZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,13c", 20, true, + [ + new PatternToken("KZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'K' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,13c", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + + } + + // Lebanon + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LB + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4n,20c", 28, true, + [ + new PatternToken("LB"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'B' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4n,20c", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 20), + ] + ); + + + } + + // Saint Lucia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,24c", 32, true, + [ + new PatternToken("LC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 24), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,24c", 28, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 24), + ] + ); + + + } + + // Liechtenstein + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("5n,12c", 21, true, + [ + new PatternToken("LI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5n,12c", 17, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + + } + + // Lithuania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("16n", 20, true, + [ + new PatternToken("LT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("16n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Luxembourg + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,13c", 20, true, + [ + new PatternToken("LU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,13c", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + + } + + // Latvia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LV + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,13c", 21, true, + [ + new PatternToken("LV"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'V' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,13c", 17, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 13), + ] + ); + + + } + + // Libya + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class LY + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("LY"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'L' + && value[pos++] == 'Y' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // Morocco + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("24n", 28, true, + [ + new PatternToken("MA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 24), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("24n", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 24), + ] + ); + + + } + + // Monaco + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("10n,11c,2n", 27, true, + [ + new PatternToken("MC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("10n,11c,2n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 11), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Moldova + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2c,18c", 24, true, + [ + new PatternToken("MD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2c,18c", 20, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + + } + + // Montenegro + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ME + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("18n", 22, true, + [ + new PatternToken("ME"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("18n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 18), + ] + ); + + + } + + // Madagascar + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("MG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // North Macedonia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,10c,2n", 19, true, + [ + new PatternToken("MK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,10c,2n", 15, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Mali + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ML + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2c,22n", 28, true, + [ + new PatternToken("ML"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2c,22n", 24, true, + [ + new PatternToken(AsciiCategory.AlphaNumeric, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Mongolia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4n,12n", 20, true, + [ + new PatternToken("MN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4n,12n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + + } + + // Mauritania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("MR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Malta + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,5n,18c", 31, true, + [ + new PatternToken("MT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,5n,18c", 27, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + + } + + // Mauritius + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MU + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,19n,3a", 30, true, + [ + new PatternToken("MU"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 19), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'U' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,19n,3a", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 19), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ); + + + } + + // Mozambique + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class MZ + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("MZ"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'M' + && value[pos++] == 'Z' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // Niger + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,22n", 28, true, + [ + new PatternToken("NE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,22n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Nicaragua + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,20n", 28, true, + [ + new PatternToken("NI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,20n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Netherlands + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,10n", 18, true, + [ + new PatternToken("NL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,10n", 14, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 10), + ] + ); + + + } + + // Norway + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class NO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("11n", 15, true, + [ + new PatternToken("NO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 11), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'N' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("11n", 11, true, + [ + new PatternToken(AsciiCategory.Digit, 11), + ] + ); + + + } + + // Oman + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class OM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,16c", 23, true, + [ + new PatternToken("OM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'O' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,16c", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Pakistan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,16c", 24, true, + [ + new PatternToken("PK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,16c", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Poland + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("24n", 28, true, + [ + new PatternToken("PL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 24), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("24n", 24, true, + [ + new PatternToken(AsciiCategory.Digit, 24), + ] + ); + + + } + + // Palestinian territories + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,21c", 29, true, + [ + new PatternToken("PS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,21c", 25, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ); + + + } + + // Portugal + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class PT + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("PT"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'P' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // Qatar + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class QA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,21c", 29, true, + [ + new PatternToken("QA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'Q' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,21c", 25, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 21), + ] + ); + + + } + + // Romania + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class RO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,16c", 24, true, + [ + new PatternToken("RO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'R' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,16c", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Serbia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class RS + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("18n", 22, true, + [ + new PatternToken("RS"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'R' + && value[pos++] == 'S' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("18n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 18), + ] + ); + + + } + + // Saudi Arabia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2n,18c", 24, true, + [ + new PatternToken("SA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2n,18c", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + + } + + // Seychelles + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SC + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,20n,3a", 31, true, + [ + new PatternToken("SC"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'C' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,20n,3a", 27, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + new PatternToken(AsciiCategory.UppercaseLetter, 3), + ] + ); + + + } + + // Sudan + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("14n", 18, true, + [ + new PatternToken("SD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 14), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("14n", 14, true, + [ + new PatternToken(AsciiCategory.Digit, 14), + ] + ); + + + } + + // Sweden + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("20n", 24, true, + [ + new PatternToken("SE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("20n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Slovenia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SI + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("15n", 19, true, + [ + new PatternToken("SI"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'I' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("15n", 15, true, + [ + new PatternToken(AsciiCategory.Digit, 15), + ] + ); + + + } + + // Slovakia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("20n", 24, true, + [ + new PatternToken("SK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("20n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // San Marino + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SM + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("1a,10n,12c", 27, true, + [ + new PatternToken("SM"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'M' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("1a,10n,12c", 23, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 1), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.AlphaNumeric, 12), + ] + ); + + + } + + // Senegal + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,22n", 28, true, + [ + new PatternToken("SN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,22n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // Somalia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SO + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4n,3n,12n", 23, true, + [ + new PatternToken("SO"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'O' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4n,3n,12n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 12), + ] + ); + + + } + + // São Tomé and Príncipe + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class ST + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("21n", 25, true, + [ + new PatternToken("ST"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 21), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'T' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("21n", 21, true, + [ + new PatternToken(AsciiCategory.Digit, 21), + ] + ); + + + } + + // El Salvador + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class SV + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,20n", 28, true, + [ + new PatternToken("SV"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'S' + && value[pos++] == 'V' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,20n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Chad + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TD + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("23n", 27, true, + [ + new PatternToken("TD"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 23), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'D' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("23n", 23, true, + [ + new PatternToken(AsciiCategory.Digit, 23), + ] + ); + + + } + + // Togo + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("2a,22n", 28, true, + [ + new PatternToken("TG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("2a,22n", 24, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 2), + new PatternToken(AsciiCategory.Digit, 22), + ] + ); + + + } + + // East Timor + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TL + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("19n", 23, true, + [ + new PatternToken("TL"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 19), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'L' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("19n", 19, true, + [ + new PatternToken(AsciiCategory.Digit, 19), + ] + ); + + + } + + // Tunisia + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TN + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("20n", 24, true, + [ + new PatternToken("TN"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 20), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'N' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("20n", 20, true, + [ + new PatternToken(AsciiCategory.Digit, 20), + ] + ); + + + } + + // Turkey + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class TR + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("5n,1n,16c", 26, true, + [ + new PatternToken("TR"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'T' + && value[pos++] == 'R' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("5n,1n,16c", 22, true, + [ + new PatternToken(AsciiCategory.Digit, 5), + new PatternToken(AsciiCategory.Digit, 1), + new PatternToken(AsciiCategory.AlphaNumeric, 16), + ] + ); + + + } + + // Ukraine + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class UA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("6n,19c", 29, true, + [ + new PatternToken("UA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 19), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'U' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("6n,19c", 25, true, + [ + new PatternToken(AsciiCategory.Digit, 6), + new PatternToken(AsciiCategory.AlphaNumeric, 19), + ] + ); + + + } + + // Vatican City + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class VA + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("3n,15n", 22, true, + [ + new PatternToken("VA"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'V' + && value[pos++] == 'A' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("3n,15n", 18, true, + [ + new PatternToken(AsciiCategory.Digit, 3), + new PatternToken(AsciiCategory.Digit, 15), + ] + ); + + + } + + // Virgin Islands, British + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class VG + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,16n", 24, true, + [ + new PatternToken("VG"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 16), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'V' + && value[pos++] == 'G' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,16n", 20, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 16), + ] + ); + + + } + + // Kosovo + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class XK + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4n,10n,2n", 20, true, + [ + new PatternToken("XK"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'X' + && value[pos++] == 'K' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4n,10n,2n", 16, true, + [ + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.Digit, 10), + new PatternToken(AsciiCategory.Digit, 2), + ] + ); + + + } + + // Yemen + [GeneratedCode("RegistryProviderTransformGenerator", "2.0")] + internal static class YE + { + + internal static readonly Pattern Iban = new IbanImpl(); + + private sealed class IbanImpl() + : Pattern("4a,4n,18c", 30, true, + [ + new PatternToken("YE"), + new PatternToken(AsciiCategory.Digit, 2), + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ) + { +#if USE_SPANS + internal sealed override bool IsMatch(ReadOnlySpan value, [NotNullWhen(false)] out int? errorPos) +#else + internal sealed override bool IsMatch(string value, [NotNullWhen(false)] out int? errorPos) +#endif + { + int pos = 0; + if (value.Length == MaxLength + && value[pos++] == 'Y' + && value[pos++] == 'E' + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsUpperAsciiLetter() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAsciiDigit() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + && value[pos++].IsAlphaNumeric() + ) + { + errorPos = null; + return true; + } + + errorPos = pos - 1; + return false; + } + } + + internal static readonly Pattern Bban = new Pattern("4a,4n,18c", 26, true, + [ + new PatternToken(AsciiCategory.UppercaseLetter, 4), + new PatternToken(AsciiCategory.Digit, 4), + new PatternToken(AsciiCategory.AlphaNumeric, 18), + ] + ); + + + } + } +} diff --git a/src/IbanNet/IbanNet.csproj b/src/IbanNet/IbanNet.csproj index 6dd180e0..56c4cb6f 100644 --- a/src/IbanNet/IbanNet.csproj +++ b/src/IbanNet/IbanNet.csproj @@ -40,14 +40,10 @@ +
- - True - True - WikipediaRegistryProvider.tt - True True @@ -74,11 +70,4 @@ - - - TextTemplatingFileGenerator - WikipediaRegistryProvider.cs - - - diff --git a/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs b/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs index 621bb715..1c427b5d 100644 --- a/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs +++ b/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs @@ -13,6 +13,20 @@ public WikipediaPatternTokenizer() { } +#if !USE_SPANS + /// + public override IEnumerable Tokenize(IEnumerable input) + { + if (input is null) + { + throw new ArgumentNullException(nameof(input)); + } + + // Filter out separators. + return base.Tokenize(input.Where(ch => ch != ',')); + } +#endif + protected override AsciiCategory GetCategory(string token) { if (token.Length <= 1) diff --git a/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.cs b/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.cs index 9e0debfd..a2547a20 100644 --- a/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.cs +++ b/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.cs @@ -1,32 +1,21 @@ -using System.CodeDom.Compiler; -using System.Collections; +using System.Collections; using System.Diagnostics; +using IbanNet.CodeGen; namespace IbanNet.Registry.Wikipedia; /// -/// This IBAN registry provider is derived from Wikipedia. +/// This IBAN registry provider contains IBAN/BBAN/SEPA information for all known IBAN countries. /// -/// -/// Note: this provider does not conform to the official spec, and is provided as an add-on. Use at your own risk. -/// -/// Generated from: https://en.wikipedia.org/wiki/International_Bank_Account_Number -/// Page ID: 15253 -/// Rev ID: 1312145599 -/// -/// -[GeneratedCode("WikiRegistryProviderT4", "1.15253-1312145599")] -public class WikipediaRegistryProvider : IIbanRegistryProvider +public partial class WikipediaRegistryProvider : IIbanRegistryProvider { [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private ICollection? _countries; + private readonly Lazy> _countries = new(() => Load().ToList()); /// public IEnumerator GetEnumerator() { - _countries = _countries ??= Load().ToList(); - - return _countries.GetEnumerator(); + return _countries.Value.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() @@ -35,894 +24,8 @@ IEnumerator IEnumerable.GetEnumerator() } /// - // ReSharper disable once UseCollectionCountProperty - justification: need to init _countries first. - public int Count => _countries?.Count ?? this.Count(); - - private static IEnumerable Load() - { - // ReSharper disable CommentTypo - // ReSharper disable StringLiteralTypo - yield return new IbanCountry("AD") - { - NativeName = "Andorra", - EnglishName = "Andorra", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AD", "8n,12c")), - Bban = new PatternDescriptor(new WikipediaPattern("8n,12c"), 4) - }; - - yield return new IbanCountry("AE") - { - NativeName = "الإمارات العربية المتحدة", - EnglishName = "United Arab Emirates", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AE", "3n,16n")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,16n"), 4) - }; - - yield return new IbanCountry("AL") - { - NativeName = "Shqipëri", - EnglishName = "Albania", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AL", "8n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("8n,16c"), 4) - }; - - yield return new IbanCountry("AO") - { - NativeName = "Angóla", - EnglishName = "Angola", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AO", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("AT") - { - NativeName = "Österreich", - EnglishName = "Austria", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AT", "16n")), - Bban = new PatternDescriptor(new WikipediaPattern("16n"), 4) - }; - - yield return new IbanCountry("AZ") - { - NativeName = "Азәрбајҹан", - EnglishName = "Azerbaijan", - Iban = new PatternDescriptor(new IbanWikipediaPattern("AZ", "4a,20c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,20c"), 4) - }; - - yield return new IbanCountry("BA") - { - NativeName = "Bosna i Hercegovina", - EnglishName = "Bosnia and Herzegovina", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BA", "16n")), - Bban = new PatternDescriptor(new WikipediaPattern("16n"), 4) - }; - - yield return new IbanCountry("BE") - { - NativeName = "België", - EnglishName = "Belgium", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BE", "12n")), - Bban = new PatternDescriptor(new WikipediaPattern("12n"), 4) - }; - - yield return new IbanCountry("BF") - { - NativeName = "Burkibaa Faaso", - EnglishName = "Burkina Faso", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BF", "2c,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2c,22n"), 4) - }; - - yield return new IbanCountry("BG") - { - NativeName = "България", - EnglishName = "Bulgaria", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BG", "4a,6n,8c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,6n,8c"), 4) - }; - - yield return new IbanCountry("BH") - { - NativeName = "البحرين", - EnglishName = "Bahrain", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BH", "4a,14c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,14c"), 4) - }; - - yield return new IbanCountry("BI") - { - NativeName = "Burundi", - EnglishName = "Burundi", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BI", "5n,5n,11n,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("5n,5n,11n,2n"), 4) - }; - - yield return new IbanCountry("BJ") - { - NativeName = "Bénin", - EnglishName = "Benin", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BJ", "2c,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2c,22n"), 4) - }; - - yield return new IbanCountry("BR") - { - NativeName = "Brasil", - EnglishName = "Brazil", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BR", "23n,1a,1c")), - Bban = new PatternDescriptor(new WikipediaPattern("23n,1a,1c"), 4) - }; - - yield return new IbanCountry("BY") - { - NativeName = "Беларусь", - EnglishName = "Belarus", - Iban = new PatternDescriptor(new IbanWikipediaPattern("BY", "4c,4n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("4c,4n,16c"), 4) - }; - - yield return new IbanCountry("CF") - { - NativeName = "République centrafricaine", - EnglishName = "Central African Republic", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CF", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("CG") - { - NativeName = "Congo", - EnglishName = "Congo, Republic of the", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CG", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("CH") - { - NativeName = "Svizzera", - EnglishName = "Switzerland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CH", "5n,12c")), - Bban = new PatternDescriptor(new WikipediaPattern("5n,12c"), 4) - }; - - yield return new IbanCountry("CI") - { - NativeName = "Côte d’Ivoire", - EnglishName = "Côte d'Ivoire", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CI", "2a,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,22n"), 4) - }; - - yield return new IbanCountry("CM") - { - NativeName = "Kàmàlûŋ", - EnglishName = "Cameroon", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CM", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("CR") - { - NativeName = "Costa Rica", - EnglishName = "Costa Rica", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CR", "18n")), - Bban = new PatternDescriptor(new WikipediaPattern("18n"), 4) - }; - - yield return new IbanCountry("CV") - { - NativeName = "Kabu Verdi", - EnglishName = "Cabo Verde", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CV", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("CY") - { - NativeName = "Κύπρος", - EnglishName = "Cyprus", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CY", "8n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("8n,16c"), 4) - }; - - yield return new IbanCountry("CZ") - { - NativeName = "Česko", - EnglishName = "Czech Republic", - Iban = new PatternDescriptor(new IbanWikipediaPattern("CZ", "20n")), - Bban = new PatternDescriptor(new WikipediaPattern("20n"), 4) - }; - - yield return new IbanCountry("DE") - { - NativeName = "Deutschland", - EnglishName = "Germany", - Iban = new PatternDescriptor(new IbanWikipediaPattern("DE", "18n")), - Bban = new PatternDescriptor(new WikipediaPattern("18n"), 4) - }; - - yield return new IbanCountry("DJ") - { - NativeName = "Yabuuti", - EnglishName = "Djibouti", - Iban = new PatternDescriptor(new IbanWikipediaPattern("DJ", "5n,5n,11n,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("5n,5n,11n,2n"), 4) - }; - - yield return new IbanCountry("DK") - { - NativeName = "Danmark", - EnglishName = "Denmark", - Iban = new PatternDescriptor(new IbanWikipediaPattern("DK", "14n")), - Bban = new PatternDescriptor(new WikipediaPattern("14n"), 4) - }; - - yield return new IbanCountry("DO") - { - NativeName = "República Dominicana", - EnglishName = "Dominican Republic", - Iban = new PatternDescriptor(new IbanWikipediaPattern("DO", "4c,20n")), - Bban = new PatternDescriptor(new WikipediaPattern("4c,20n"), 4) - }; - - yield return new IbanCountry("DZ") - { - NativeName = "الجزائر", - EnglishName = "Algeria", - Iban = new PatternDescriptor(new IbanWikipediaPattern("DZ", "22n")), - Bban = new PatternDescriptor(new WikipediaPattern("22n"), 4) - }; - - yield return new IbanCountry("EE") - { - NativeName = "Eesti", - EnglishName = "Estonia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("EE", "16n")), - Bban = new PatternDescriptor(new WikipediaPattern("16n"), 4) - }; - - yield return new IbanCountry("EG") - { - NativeName = "مصر", - EnglishName = "Egypt", - Iban = new PatternDescriptor(new IbanWikipediaPattern("EG", "25n")), - Bban = new PatternDescriptor(new WikipediaPattern("25n"), 4) - }; - - yield return new IbanCountry("ES") - { - NativeName = "España", - EnglishName = "Spain", - Iban = new PatternDescriptor(new IbanWikipediaPattern("ES", "20n")), - Bban = new PatternDescriptor(new WikipediaPattern("20n"), 4) - }; - - yield return new IbanCountry("FI") - { - NativeName = "Suomi", - EnglishName = "Finland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("FI", "14n")), - Bban = new PatternDescriptor(new WikipediaPattern("14n"), 4) - }; - - yield return new IbanCountry("FK") - { - NativeName = "Falkland Islands", - EnglishName = "Falkland Islands", - Iban = new PatternDescriptor(new IbanWikipediaPattern("FK", "2a,12n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,12n"), 4) - }; - - yield return new IbanCountry("FO") - { - NativeName = "Føroyar", - EnglishName = "Faroe Islands", - Iban = new PatternDescriptor(new IbanWikipediaPattern("FO", "14n")), - Bban = new PatternDescriptor(new WikipediaPattern("14n"), 4) - }; - - yield return new IbanCountry("FR") - { - NativeName = "France", - EnglishName = "France", - Iban = new PatternDescriptor(new IbanWikipediaPattern("FR", "10n,11c,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("10n,11c,2n"), 4) - }; - - yield return new IbanCountry("GA") - { - NativeName = "Gabon", - EnglishName = "Gabon", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GA", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("GB") - { - NativeName = "United Kingdom", - EnglishName = "United Kingdom", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GB", "4a,14n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,14n"), 4) - }; - - yield return new IbanCountry("GE") - { - NativeName = "საქართველო", - EnglishName = "Georgia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GE", "2a,16n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,16n"), 4) - }; - - yield return new IbanCountry("GI") - { - NativeName = "Gibraltar", - EnglishName = "Gibraltar", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GI", "4a,15c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,15c"), 4) - }; - - yield return new IbanCountry("GL") - { - NativeName = "Kalaallit Nunaat", - EnglishName = "Greenland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GL", "14n")), - Bban = new PatternDescriptor(new WikipediaPattern("14n"), 4) - }; - - yield return new IbanCountry("GQ") - { - NativeName = "Guinea Ecuatorial", - EnglishName = "Equatorial Guinea", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GQ", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("GR") - { - NativeName = "Ελλάδα", - EnglishName = "Greece", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GR", "7n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("7n,16c"), 4) - }; - - yield return new IbanCountry("GT") - { - NativeName = "Guatemala", - EnglishName = "Guatemala", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GT", "4c,20c")), - Bban = new PatternDescriptor(new WikipediaPattern("4c,20c"), 4) - }; - - yield return new IbanCountry("GW") - { - NativeName = "Gine-Bisaawo", - EnglishName = "Guinea-Bissau", - Iban = new PatternDescriptor(new IbanWikipediaPattern("GW", "2c,19n")), - Bban = new PatternDescriptor(new WikipediaPattern("2c,19n"), 4) - }; - - yield return new IbanCountry("HN") - { - NativeName = "Honduras", - EnglishName = "Honduras", - Iban = new PatternDescriptor(new IbanWikipediaPattern("HN", "4a,20n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,20n"), 4) - }; - - yield return new IbanCountry("HR") - { - NativeName = "Hrvatska", - EnglishName = "Croatia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("HR", "17n")), - Bban = new PatternDescriptor(new WikipediaPattern("17n"), 4) - }; - - yield return new IbanCountry("HU") - { - NativeName = "Magyarország", - EnglishName = "Hungary", - Iban = new PatternDescriptor(new IbanWikipediaPattern("HU", "24n")), - Bban = new PatternDescriptor(new WikipediaPattern("24n"), 4) - }; - - yield return new IbanCountry("IE") - { - NativeName = "Ireland", - EnglishName = "Ireland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IE", "4a,6n,8n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,6n,8n"), 4) - }; - - yield return new IbanCountry("IL") - { - NativeName = "ישראל", - EnglishName = "Israel", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IL", "19n")), - Bban = new PatternDescriptor(new WikipediaPattern("19n"), 4) - }; - - yield return new IbanCountry("IQ") - { - NativeName = "العراق", - EnglishName = "Iraq", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IQ", "4a,15n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,15n"), 4) - }; - - yield return new IbanCountry("IR") - { - NativeName = "ایران", - EnglishName = "Iran", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IR", "22n")), - Bban = new PatternDescriptor(new WikipediaPattern("22n"), 4) - }; - - yield return new IbanCountry("IS") - { - NativeName = "Ísland", - EnglishName = "Iceland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IS", "22n")), - Bban = new PatternDescriptor(new WikipediaPattern("22n"), 4) - }; - - yield return new IbanCountry("IT") - { - NativeName = "Italia", - EnglishName = "Italy", - Iban = new PatternDescriptor(new IbanWikipediaPattern("IT", "1a,10n,12c")), - Bban = new PatternDescriptor(new WikipediaPattern("1a,10n,12c"), 4) - }; - - yield return new IbanCountry("JO") - { - NativeName = "الأردن", - EnglishName = "Jordan", - Iban = new PatternDescriptor(new IbanWikipediaPattern("JO", "4a,4n,18c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,4n,18c"), 4) - }; + public int Count { get => _countries.Value.Count; } - yield return new IbanCountry("KM") - { - NativeName = "جزر القمر", - EnglishName = "Comoros", - Iban = new PatternDescriptor(new IbanWikipediaPattern("KM", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("KW") - { - NativeName = "الكويت", - EnglishName = "Kuwait", - Iban = new PatternDescriptor(new IbanWikipediaPattern("KW", "4a,22c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,22c"), 4) - }; - - yield return new IbanCountry("KZ") - { - NativeName = "Қазақстан", - EnglishName = "Kazakhstan", - Iban = new PatternDescriptor(new IbanWikipediaPattern("KZ", "3n,13c")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,13c"), 4) - }; - - yield return new IbanCountry("LB") - { - NativeName = "لبنان", - EnglishName = "Lebanon", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LB", "4n,20c")), - Bban = new PatternDescriptor(new WikipediaPattern("4n,20c"), 4) - }; - - yield return new IbanCountry("LC") - { - NativeName = "St. Lucia", - EnglishName = "Saint Lucia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LC", "4a,24c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,24c"), 4) - }; - - yield return new IbanCountry("LI") - { - NativeName = "Liechtenstein", - EnglishName = "Liechtenstein", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LI", "5n,12c")), - Bban = new PatternDescriptor(new WikipediaPattern("5n,12c"), 4) - }; - - yield return new IbanCountry("LT") - { - NativeName = "Lietuva", - EnglishName = "Lithuania", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LT", "16n")), - Bban = new PatternDescriptor(new WikipediaPattern("16n"), 4) - }; - - yield return new IbanCountry("LU") - { - NativeName = "Lëtzebuerg", - EnglishName = "Luxembourg", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LU", "3n,13c")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,13c"), 4) - }; - - yield return new IbanCountry("LV") - { - NativeName = "Latvija", - EnglishName = "Latvia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LV", "4a,13c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,13c"), 4) - }; - - yield return new IbanCountry("LY") - { - NativeName = "ليبيا", - EnglishName = "Libya", - Iban = new PatternDescriptor(new IbanWikipediaPattern("LY", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("MA") - { - NativeName = "المملكة المغربية", - EnglishName = "Morocco", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MA", "24n")), - Bban = new PatternDescriptor(new WikipediaPattern("24n"), 4) - }; - - yield return new IbanCountry("MC") - { - NativeName = "Monaco", - EnglishName = "Monaco", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MC", "10n,11c,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("10n,11c,2n"), 4) - }; - - yield return new IbanCountry("MD") - { - NativeName = "Republica Moldova", - EnglishName = "Moldova", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MD", "2c,18c")), - Bban = new PatternDescriptor(new WikipediaPattern("2c,18c"), 4) - }; - - yield return new IbanCountry("ME") - { - NativeName = "Crna Gora", - EnglishName = "Montenegro", - Iban = new PatternDescriptor(new IbanWikipediaPattern("ME", "18n")), - Bban = new PatternDescriptor(new WikipediaPattern("18n"), 4) - }; - - yield return new IbanCountry("MG") - { - NativeName = "Madagascar", - EnglishName = "Madagascar", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MG", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("MK") - { - NativeName = "Северна Македонија", - EnglishName = "North Macedonia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MK", "3n,10c,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,10c,2n"), 4) - }; - - yield return new IbanCountry("ML") - { - NativeName = "Mali", - EnglishName = "Mali", - Iban = new PatternDescriptor(new IbanWikipediaPattern("ML", "2c,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2c,22n"), 4) - }; - - yield return new IbanCountry("MN") - { - NativeName = "Монгол", - EnglishName = "Mongolia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MN", "4n,12n")), - Bban = new PatternDescriptor(new WikipediaPattern("4n,12n"), 4) - }; - - yield return new IbanCountry("MR") - { - NativeName = "موريتانيا", - EnglishName = "Mauritania", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MR", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("MT") - { - NativeName = "Malta", - EnglishName = "Malta", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MT", "4a,5n,18c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,5n,18c"), 4) - }; - - yield return new IbanCountry("MU") - { - NativeName = "Mauritius", - EnglishName = "Mauritius", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MU", "4a,19n,3a")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,19n,3a"), 4) - }; - - yield return new IbanCountry("MZ") - { - NativeName = "Umozambiki", - EnglishName = "Mozambique", - Iban = new PatternDescriptor(new IbanWikipediaPattern("MZ", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("NE") - { - NativeName = "Nižer", - EnglishName = "Niger", - Iban = new PatternDescriptor(new IbanWikipediaPattern("NE", "2a,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,22n"), 4) - }; - - yield return new IbanCountry("NI") - { - NativeName = "Nicaragua", - EnglishName = "Nicaragua", - Iban = new PatternDescriptor(new IbanWikipediaPattern("NI", "4a,20n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,20n"), 4) - }; - - yield return new IbanCountry("NL") - { - NativeName = "Nederland", - EnglishName = "Netherlands", - Iban = new PatternDescriptor(new IbanWikipediaPattern("NL", "4a,10n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,10n"), 4) - }; - - yield return new IbanCountry("NO") - { - NativeName = "Noreg", - EnglishName = "Norway", - Iban = new PatternDescriptor(new IbanWikipediaPattern("NO", "11n")), - Bban = new PatternDescriptor(new WikipediaPattern("11n"), 4) - }; - - yield return new IbanCountry("OM") - { - NativeName = "عمان", - EnglishName = "Oman", - Iban = new PatternDescriptor(new IbanWikipediaPattern("OM", "3n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,16c"), 4) - }; - - yield return new IbanCountry("PK") - { - NativeName = "پاکستان", - EnglishName = "Pakistan", - Iban = new PatternDescriptor(new IbanWikipediaPattern("PK", "4a,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,16c"), 4) - }; - - yield return new IbanCountry("PL") - { - NativeName = "Polska", - EnglishName = "Poland", - Iban = new PatternDescriptor(new IbanWikipediaPattern("PL", "24n")), - Bban = new PatternDescriptor(new WikipediaPattern("24n"), 4) - }; - - yield return new IbanCountry("PS") - { - NativeName = "السلطة الفلسطينية", - EnglishName = "Palestinian territories", - Iban = new PatternDescriptor(new IbanWikipediaPattern("PS", "4a,21c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,21c"), 4) - }; - - yield return new IbanCountry("PT") - { - NativeName = "Portugal", - EnglishName = "Portugal", - Iban = new PatternDescriptor(new IbanWikipediaPattern("PT", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("QA") - { - NativeName = "قطر", - EnglishName = "Qatar", - Iban = new PatternDescriptor(new IbanWikipediaPattern("QA", "4a,21c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,21c"), 4) - }; - - yield return new IbanCountry("RO") - { - NativeName = "România", - EnglishName = "Romania", - Iban = new PatternDescriptor(new IbanWikipediaPattern("RO", "4a,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,16c"), 4) - }; - - yield return new IbanCountry("RS") - { - NativeName = "Srbija", - EnglishName = "Serbia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("RS", "18n")), - Bban = new PatternDescriptor(new WikipediaPattern("18n"), 4) - }; - - yield return new IbanCountry("SA") - { - NativeName = "المملكة العربية السعودية", - EnglishName = "Saudi Arabia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SA", "2n,18c")), - Bban = new PatternDescriptor(new WikipediaPattern("2n,18c"), 4) - }; - - yield return new IbanCountry("SC") - { - NativeName = "Seychelles", - EnglishName = "Seychelles", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SC", "4a,20n,3a")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,20n,3a"), 4) - }; - - yield return new IbanCountry("SD") - { - NativeName = "السودان", - EnglishName = "Sudan", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SD", "14n")), - Bban = new PatternDescriptor(new WikipediaPattern("14n"), 4) - }; - - yield return new IbanCountry("SE") - { - NativeName = "Sverige", - EnglishName = "Sweden", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SE", "20n")), - Bban = new PatternDescriptor(new WikipediaPattern("20n"), 4) - }; - - yield return new IbanCountry("SI") - { - NativeName = "Slovenija", - EnglishName = "Slovenia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SI", "15n")), - Bban = new PatternDescriptor(new WikipediaPattern("15n"), 4) - }; - - yield return new IbanCountry("SK") - { - NativeName = "Slovensko", - EnglishName = "Slovakia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SK", "20n")), - Bban = new PatternDescriptor(new WikipediaPattern("20n"), 4) - }; - - yield return new IbanCountry("SM") - { - NativeName = "San Marino", - EnglishName = "San Marino", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SM", "1a,10n,12c")), - Bban = new PatternDescriptor(new WikipediaPattern("1a,10n,12c"), 4) - }; - - yield return new IbanCountry("SN") - { - NativeName = "Senegaal", - EnglishName = "Senegal", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SN", "2a,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,22n"), 4) - }; - - yield return new IbanCountry("SO") - { - NativeName = "الصومال", - EnglishName = "Somalia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SO", "4n,3n,12n")), - Bban = new PatternDescriptor(new WikipediaPattern("4n,3n,12n"), 4) - }; - - yield return new IbanCountry("ST") - { - NativeName = "São Tomé e Príncipe", - EnglishName = "São Tomé and Príncipe", - Iban = new PatternDescriptor(new IbanWikipediaPattern("ST", "21n")), - Bban = new PatternDescriptor(new WikipediaPattern("21n"), 4) - }; - - yield return new IbanCountry("SV") - { - NativeName = "El Salvador", - EnglishName = "El Salvador", - Iban = new PatternDescriptor(new IbanWikipediaPattern("SV", "4a,20n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,20n"), 4) - }; - - yield return new IbanCountry("TD") - { - NativeName = "تشاد", - EnglishName = "Chad", - Iban = new PatternDescriptor(new IbanWikipediaPattern("TD", "23n")), - Bban = new PatternDescriptor(new WikipediaPattern("23n"), 4) - }; - - yield return new IbanCountry("TG") - { - NativeName = "Togo nutome", - EnglishName = "Togo", - Iban = new PatternDescriptor(new IbanWikipediaPattern("TG", "2a,22n")), - Bban = new PatternDescriptor(new WikipediaPattern("2a,22n"), 4) - }; - - yield return new IbanCountry("TL") - { - NativeName = "Timor-Leste", - EnglishName = "East Timor", - Iban = new PatternDescriptor(new IbanWikipediaPattern("TL", "19n")), - Bban = new PatternDescriptor(new WikipediaPattern("19n"), 4) - }; - - yield return new IbanCountry("TN") - { - NativeName = "تونس", - EnglishName = "Tunisia", - Iban = new PatternDescriptor(new IbanWikipediaPattern("TN", "20n")), - Bban = new PatternDescriptor(new WikipediaPattern("20n"), 4) - }; - - yield return new IbanCountry("TR") - { - NativeName = "Türkiye", - EnglishName = "Turkey", - Iban = new PatternDescriptor(new IbanWikipediaPattern("TR", "5n,1n,16c")), - Bban = new PatternDescriptor(new WikipediaPattern("5n,1n,16c"), 4) - }; - - yield return new IbanCountry("UA") - { - NativeName = "Україна", - EnglishName = "Ukraine", - Iban = new PatternDescriptor(new IbanWikipediaPattern("UA", "6n,19c")), - Bban = new PatternDescriptor(new WikipediaPattern("6n,19c"), 4) - }; - - yield return new IbanCountry("VA") - { - NativeName = "Città del Vaticano", - EnglishName = "Vatican City", - Iban = new PatternDescriptor(new IbanWikipediaPattern("VA", "3n,15n")), - Bban = new PatternDescriptor(new WikipediaPattern("3n,15n"), 4) - }; - - yield return new IbanCountry("VG") - { - NativeName = "British Virgin Islands", - EnglishName = "Virgin Islands, British", - Iban = new PatternDescriptor(new IbanWikipediaPattern("VG", "4a,16n")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,16n"), 4) - }; - - yield return new IbanCountry("XK") - { - NativeName = "Kosovë", - EnglishName = "Kosovo", - Iban = new PatternDescriptor(new IbanWikipediaPattern("XK", "4n,10n,2n")), - Bban = new PatternDescriptor(new WikipediaPattern("4n,10n,2n"), 4) - }; - - yield return new IbanCountry("YE") - { - NativeName = "اليمن", - EnglishName = "Yemen", - Iban = new PatternDescriptor(new IbanWikipediaPattern("YE", "4a,4n,18c")), - Bban = new PatternDescriptor(new WikipediaPattern("4a,4n,18c"), 4) - }; - - // ReSharper restore StringLiteralTypo - // ReSharper restore CommentTypo - } + [RegistrySource(RegistrySource.Wikipedia, @"api-result-1312145599.json")] + private static partial IEnumerable Load(); } diff --git a/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.tt b/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.tt deleted file mode 100644 index d7d042e4..00000000 --- a/src/IbanNet/Registry/Wikipedia/WikipediaRegistryProvider.tt +++ /dev/null @@ -1,100 +0,0 @@ -<#@ template hostspecific="true" language="C#" #> -<#@ assembly name="NetStandard" #> -<#@ assembly name="System.Core" #> -<#@ assembly name="System.Linq" #> -<#@ assembly name="System.Memory" #> -<#@ assembly name="System.Text.Json" #> -<#@ assembly name="System.Text.RegularExpressions" #> -<#@ assembly name="System.Xml" #> -<#@ assembly name="System.Xml.Linq" #> -<#@ assembly name="$(SolutionDir)\src\IbanNet.CodeGen\bin\$(Configuration)\netstandard2.0\IbanNet.CodeGen.dll" #> -<#@ assembly name="$(SolutionDir)\src\IbanNet\bin\$(Configuration)\netstandard2.0\IbanNet.dll" #> -<#@ import namespace="System.Collections.Generic" #> -<#@ import namespace="System.Globalization" #> -<#@ import namespace="System.IO" #> -<#@ import namespace="System.Linq" #> -<#@ import namespace="System.Net" #> -<#@ import namespace="System.Text.Json" #> -<#@ import namespace="System.Text.RegularExpressions" #> -<#@ import namespace="System.Xml.Linq" #> -<#@ import namespace="System.Xml.XPath" #> -<#@ import namespace="IbanNet.CodeGen.Wikipedia" #> -using System.CodeDom.Compiler; -using System.Collections; -using System.Diagnostics; - -namespace IbanNet.Registry.Wikipedia; - -<# - // Generate provider from Wikipedia. - - var wikiResponse = Loader.GetWikiData(); -#> -/// -/// This IBAN registry provider is derived from Wikipedia. -/// -/// -/// Note: this provider does not conform to the official spec, and is provided as an add-on. Use at your own risk. -/// -/// Generated from: https://en.wikipedia.org/wiki/International_Bank_Account_Number -/// Page ID: <#= wikiResponse.Parse.PageId #> -/// Rev ID: <#= wikiResponse.Parse.RevId #> -/// -/// -[GeneratedCode("WikiRegistryProviderT4", "1.<#= wikiResponse.Parse.PageId #>-<#= wikiResponse.Parse.RevId #>")] -public class WikipediaRegistryProvider : IIbanRegistryProvider -{ - [DebuggerBrowsable(DebuggerBrowsableState.Never)] - private ICollection? _countries; - - /// - public IEnumerator GetEnumerator() - { - _countries = _countries ??= Load().ToList(); - - return _countries.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - /// - // ReSharper disable once UseCollectionCountProperty - justification: need to init _countries first. - public int Count => _countries?.Count ?? this.Count(); - - private static IEnumerable Load() - { - // ReSharper disable CommentTypo - // ReSharper disable StringLiteralTypo -<# - var wikiSpecs = wikiResponse.Records - .Where(x => !Boycott(x.CountryCode)) - .OrderBy(x => x.CountryCode) - .ToList(); - - foreach (var x in wikiSpecs) - { -#> - yield return new IbanCountry("<#= x.CountryCode #>") - { - NativeName = "<#= x.NativeName ?? x.EnglishName #>", - EnglishName = "<#= x.EnglishName #>", - Iban = new PatternDescriptor(new IbanWikipediaPattern("<#= x.CountryCode #>", "<#= x.Pattern #>")), - Bban = new PatternDescriptor(new WikipediaPattern("<#= x.Pattern #>"), 4) - }; - -<# - } -#> - // ReSharper restore StringLiteralTypo - // ReSharper restore CommentTypo - } -} -<#+ -private static bool Boycott(string countryCode) -{ - return countryCode == "RU"; // Go Ukraine! -} -#> diff --git a/src/IbanNet/Registry/Wikipedia/api-result-1312145599.json b/src/IbanNet/Registry/Wikipedia/api-result-1312145599.json new file mode 100644 index 00000000..e803f470 --- /dev/null +++ b/src/IbanNet/Registry/Wikipedia/api-result-1312145599.json @@ -0,0 +1 @@ +{"parse":{"title":"International Bank Account Number","pageid":15253,"revid":1312145599,"text":{"*":"

IBAN formats by country

[edit]
\n

This table summarises the IBAN formats by country:[1]\n

\n
  • The kk after the two-character ISO country code represents the check digits calculated from the rest of the IBAN characters. If it is a constant for the country concerned, this will be stated in the Comments column. This happens where the BBAN has its own check digits that use the same algorithm as the IBAN check digits
  • \n
  • The BBAN format column shows the format of the BBAN part of an IBAN in terms of upper case alpha characters (A\u2013Z) denoted by \"a\", numeric characters (0\u20139) denoted by \"n\" and mixed case alphanumeric characters (a\u2013z, A\u2013Z, 0\u20139) denoted by \"c\". For example, the Bulgarian BBAN (4a,6n,8c) consists of 4 alpha characters, followed by 6 numeric characters, then by 8 mixed-case alpha-numeric characters
  • \n
  • Descriptions in the Comments field have been standardised with country-specific names in brackets. The format of the various fields can be deduced from the BBAN field
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
International Bank Account Number formats by country\n
Country\nChars\nBBAN format\nIBAN Fields\nComment\n
Albania\n28\n8n,16c\nALkk bbbs sssx cccc cccc cccc cccc\nb = National bank code
s = Branch code
x = National check digits
c = Account number\n
Andorra\n24\n8n,12c\nADkk bbbb ssss cccc cccc cccc\nb = National bank code
s = Branch code
c = Account number\n
Austria\n20\n16n\nATkk bbbb bccc cccc cccc\nb = National bank code
c = Account number\n
Azerbaijan\n28\n4a,20c\nAZkk bbbb cccc cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Bahrain\n22\n4a,14c\nBHkk bbbb cccc cccc cccc cc\nb = National bank code
c = Account number\n
Belarus\n28\n4c, 4n, 16c\nBYkk bbbb aaaa cccc cccc cccc cccc\nb = National bank or branch code
a = Balance account number
c = Account number\n
Belgium\n16\n12n\nBEkk bbbc cccc ccxx\nb = National bank code
c = Account number
x = National check digits\n
Bosnia and Herzegovina\n20\n16n\nBAkk bbbs sscc cccc ccxx\nk = IBAN check digits (always \"39\")
b = National bank code
s = Branch code
c = Account number
x = National check digits\n
Brazil\n29\n23n,1a,1c\nBRkk bbbb bbbb ssss sccc cccc ccct n\nb = National bank code
s = Branch code
c = Account number
t = Account type (cheque account, savings account etc.)
n = Owner account number (\"1\", \"2\" etc.)[2]\n
Bulgaria\n22\n4a,6n,8c\nBGkk bbbb ssss ttcc cccc cc\nb = BIC bank code
s = Branch (BAE) number
t = Account type
c = Account number\n
Burundi\n27\n5n, 5n, 11n, 2n\nBIkk bbbb bsss sscc cccc cccc ccc\nb = National bank code
s = Branch identifier
c = Account number\n
Costa Rica\n22\n18n\nCRkk 0bbb cccc cccc cccc cc\n0 = always zero
b = bank code
c = Account number\n
Croatia\n21\n17n\nHRkk bbbb bbbc cccc cccc c\nb = Bank code
c = Account number\n
Cyprus\n28\n8n,16c\nCYkk bbbs ssss cccc cccc cccc cccc\nb = National bank code
s = Branch code
c = Account number\n
Czech Republic\n24\n20n\nCZkk bbbb pppp ppcc cccc cccc\nb = National bank code
p = Account number prefix
c = Account number\n
Denmark\n18\n14n\nDKkk bbbb cccc cccc cx\nb = National bank code
c = Account number
x = National check digit\n
Djibouti\n27\n5n, 5n, 11n, 2n\nDJkk bbbb bsss sscc cccc cccc ccc\nb = National bank code
s = Branch identifier
c = Account number\n
Dominican Republic\n28\n4c,20n\nDOkk bbbb cccc cccc cccc cccc cccc\nb = Bank identifier
c = Account number\n
East Timor\n23\n19n\nTLkk bbbc cccc cccc cccc cxx\nk = IBAN check digits (always = \"38\")
b = Bank identifier
c = Account number
x = National check digits\n
Egypt\n29\n25n\nEGkk bbbb ssss cccc cccc cccc cccc c\nb = National bank code
s = Branch code
c = Account number
\n
El Salvador\n28\n4a, 20n\nSVkk bbbb cccc cccc cccc cccc cccc\nb = National bank code
c = Account number
\n
Estonia\n20\n16n\nEEkk bbss cccc cccc cccx\nb = National bank code
s = Branch code
c = Account number
x = National check digit\n
Falkland Islands\n18\n2a,12n\nFKkk bbcc cccc cccc cc\nb = National bank code
c = Account number\n
Faroe Islands[Note 1]\n18\n14n\nFOkk bbbb cccc cccc cx\nb = National bank code
c = Account number
x = National check digit\n
Finland\n18\n14n\nFIkk bbbb bbcc cccc cx\nb = Bank and branch code
c = Account number
x = National check digit\n
France[Note 2]\n27\n10n,11c,2n\nFRkk bbbb bsss sscc cccc cccc cxx\nb = National bank code
s = Branch code (code guichet [fr])
c = Account number
x = National check digits (cl\u00e9 RIB [fr])\n
Georgia\n22\n2a,16n\nGEkk bbcc cccc cccc cccc cc\nb = National bank code
c = Account number\n
Germany\n22\n18n\nDEkk bbbb bbbb cccc cccc cc\nb = Bank and branch identifier (Bankleitzahl or BLZ)
c = Account number\n
Gibraltar\n23\n4a,15c\nGIkk bbbb cccc cccc cccc ccc\nb = BIC bank code
c = Account number\n
Greece\n27\n7n,16c\nGRkk bbbs sssc cccc cccc cccc ccc\nb = National bank code
s = Branch code
c = Account number\n
Greenland[Note 1]\n18\n14n\nGLkk bbbb cccc cccc cx\nb = National bank code
c = Account number
x = National check digit\n
Guatemala\n28\n4c,20c\nGTkk bbbb mmtt cccc cccc cccc cccc\nb = National bank code
c = Account number
m = Currency code
t = Account type\n
Honduras\n28\n4a,20n\nHNkk bbbb cccc cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Hungary\n28\n24n\nHUkk bbbs sssx cccc cccc cccc cccx\nb = National bank code
s = Branch code
c = Account number
x = National check digit\n
Iceland\n26\n22n\nISkk bbss ttcc cccc iiii iiii ii\nb = National bank code
s = Branch code
t = Account type
c = Account number
i = Account holder's kennitala (national identification number)\n
Iraq\n23\n4a,15n\nIQkk bbbb sssc cccc cccc ccc\nb = National bank code
s = Branch code
c = Account number\n
Ireland\n22\n4a,6n,8n\nIEkk qqqq bbbb bbcc cccc cc\nq = BIC bank code
b = Bank/branch code (sort code)
c = Account number\n
Israel\n23\n19n\nILkk bbbs sscc cccc cccc ccc\nb = National bank code
s = Branch code
c = Account number 13 digits (padded with zeros)\n
Italy\n27\n1a,10n,12c\nITkk xbbb bbss sssc cccc cccc ccc\nx = Check character (codice CIN [it])
b = National bank code (codice ABI [it])
s = Branch code (codice CAB [it])
c = Account number\n
Jordan\n30\n4a,4n,18c\nJOkk bbbb ssss cccc cccc cccc cccc cc\nb = National bank code
s = Branch code
c = Account number\n
Kazakhstan\n20\n3n,13c\nKZkk bbbc cccc cccc cccc\nb = National bank code
c = Account number\n
Kosovo\n20\n4n,10n,2n\nXKkk bbbb cccc cccc cccc\nb = National bank code
c = Account number\n
Kuwait\n30\n4a,22c\nKWkk bbbb cccc cccc cccc cccc cccc cc\nb = National bank code
c = Account number.\n
Latvia\n21\n4a,13c\nLVkk bbbb cccc cccc cccc c\nb = BIC bank code
c = Account number\n
Lebanon\n28\n4n,20c\nLBkk bbbb cccc cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Libya\n25\n21n\nLYkk bbbs sscc cccc cccc cccc c\nb = National bank code
s = Branch code
c = Account number\n
Liechtenstein\n21\n5n,12c\nLIkk bbbb bccc cccc cccc c\nb = National bank code
c = Account number\n
Lithuania\n20\n16n\nLTkk bbbb bccc cccc cccc\nb = National bank code
c = Account number\n
Luxembourg\n20\n3n,13c\nLUkk bbbc cccc cccc cccc\nb = National bank code
c = Account number\n
Malta\n31\n4a,5n,18c\nMTkk bbbb ssss sccc cccc cccc cccc ccc\nb = BIC bank code
s = Branch code
c = Account number\n
Mauritania\n27\n23n\nMRkk bbbb bsss sscc cccc cccc cxx\nk = IBAN check digits (always \"13\")
b = National bank code
s = Branch code (code guichet [fr])
c = Account number
x = National check digits (cl\u00e9 RIB [fr])\n
Mauritius\n30\n4a,19n,3a\nMUkk bbbb bbss cccc cccc cccc 000m mm\nb = National bank code
s = Branch identifier
c = Account number
0 = Zeroes
m = Currency code\n
Monaco\n27\n10n,11c,2n\nMCkk bbbb bsss sscc cccc cccc cxx\nb = National bank code
s = Branch code (code guichet [fr])
c = Account number
x = National check digits (cl\u00e9 RIB [fr]).\n
Moldova\n24\n2c,18c\nMDkk bbcc cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Mongolia\n20\n4n,12n\nMNkk bbbb cccc cccc cccc\nb = National bank code
c = Account number\n
Montenegro\n22\n18n\nMEkk bbbc cccc cccc cccc xx\nk = IBAN check digits (always = \"25\")
b = Bank code
c = Account number
x = National check digits\n
Netherlands[Note 3]\n18\n4a,10n\nNLkk bbbb cccc cccc cc\nb = BIC Bank code
c = Account number\n
Nicaragua\n28\n4a, 20n\nNIkk aaaa cccc cccc cccc cccc cccc\na = National bank code
c = Account number
\n
North Macedonia\n19\n3n,10c,2n\nMKkk bbbc cccc cccc cxx\nk = IBAN check digits (always = \"07\")
b = National bank code
c = Account number
x = National check digits\n
Norway\n15\n11n\nNOkk bbbb cccc ccx\nb = National bank code
c = Account number
x = Modulo-11 national check digit\n
Oman\n23\n3n,16c\nOMkk bbbc cccc cccc cccc ccc\nb = National bank code
c = Account number\n
Pakistan\n24\n4a,16c\nPKkk bbbb cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Palestinian territories\n29\n4a,21c\nPSkk bbbb cccc cccc cccc cccc cccc c\nb = National bank code
c = Account number\n
Poland\n28\n24n\nPLkk bbbb bbbb cccc cccc cccc cccc\nb = National bank code
c = Account number[3][4]\n
Portugal\n25\n21n\nPTkk bbbb ssss cccc cccc cccx x\nk = IBAN check digits (always = \"50\")
b = National bank code (numeric only)
s = Branch code (numeric only)
c = Account number (numeric only)
x = National check digits (numeric only)\n
Qatar\n29\n4a,21c\nQAkk bbbb cccc cccc cccc cccc cccc c\nb = National bank code
c = Account number[5]\n
Romania\n24\n4a,16c\nROkk bbbb cccc cccc cccc cccc\nb = BIC Bank code (first four alpha characters)
c = Branch code and account number (bank-specific format)\n
Russia
(effective April 2023)
[1]\n
33\n14n,15c\nRUkk bbbb bbbb bsss sscc cccc cccc cccc c\nb = Bank code
s = Branch code
c = Account number\n
Saint Lucia\n32\n4a,24c\nLCkk bbbb cccc cccc cccc cccc cccc cccc\nb = Bank code
c = Account number\n
San Marino\n27\n1a,10n,12c\nSMkk xbbb bbss sssc cccc cccc ccc\nx = Check character (codice CIN [it])
b = National bank code (codice ABI [it])
s = Branch code (codice CAB [it])
c = Account number\n
S\u00e3o Tom\u00e9 and Pr\u00edncipe\n25\n21n\nSTkk bbbb ssss cccc cccc cccc c\nb = National bank code
s = Branch number
c = Account number\n
Saudi Arabia\n24\n2n,18c\nSAkk bbcc cccc cccc cccc cccc\nb = National bank code
c = Account number preceded by zeros, if required\n
Serbia\n22\n18n\nRSkk bbbc cccc cccc cccc xx\nk = IBAN check digits (always = \"35\")\n

b = National bank code
c = Account number
x = Account check digits\n

\n
Seychelles\n31\n4a,20n,3a\nSCkk bbbb bb ss cccc cccc cccc cccc mmm\nb = Bank code
s = Branch code
c = Account number
m = Currency code\n
Slovakia\n24\n20n\nSKkk bbbb pppp ppcc cccc cccc\nb = National bank code
p = Account number prefix
c = Account number\n
Slovenia\n19\n15n\nSIkk bbss sccc cccc cxx\nk = IBAN check digits (always = \"56\")
b = National bank code
s = Branch code
c = Account number
x = National check digits\n
Somalia\n23\n4n,3n, 12n\nSOkk bbbb sssc cccc cccc ccc\nb = National bank code
s = Branch code
c = Account number\n
Spain\n24\n20n\nESkk bbbb ssss xxcc cccc cccc\nb = National bank
s = Branch code
x = Check digits
c = Account number\n
Sudan\n18\n14n\nSDkk bbcc cccc cccc cc\nb = National bank code
c = Account number\n
Sweden\n24\n20n\nSEkk bbbc cccc cccc cccc cccx\nb = National bank code
c = Account number
x = Check digits\n
Switzerland\n21\n5n,12c\nCHkk bbbb bccc cccc cccc c\nb = National bank code
c = Code identifying a bank account\n
Tunisia\n24\n20n\nTNkk bbss sccc cccc cccc ccxx\nk = IBAN check digits (always \"59\")
b = National bank code
s = Branch code
c = Account number
x = National check digits\n
Turkey\n26\n5n,1n,16c\nTRkk bbbb b0cc cccc cccc cccc cc\nb = National bank code
0 = Zero (reserved)
c = Account number\n
Ukraine\n29\n6n, 19c\nUAkk bbbb bbcc cccc cccc cccc cccc c\nb = Bank code
c = Account number preceded by zeros, if required\n
United Arab Emirates\n23\n3n,16n\nAEkk bbbc cccc cccc cccc ccc\nb = National bank code
c = Account number\n
United Kingdom[Note 4]\n22\n4a,14n\nGBkk bbbb ssss sscc cccc cc\nb = BIC bank code
s = Bank and branch code (sort code)
c = Account number\n
Vatican City\n22\n3n,15n\nVAkk bbbc cccc cccc cccc cc\nb = National bank code
c = Account number\n
Virgin Islands, British\n24\n4a,16n\nVGkk bbbb cccc cccc cccc cccc\nb = National bank code
c = Account number\n
Yemen\n30\n4a,4n,18c\nYEkk bbbb ssss cccc cccc cccc cccc cc\nb = Bank code
s = Branch code
c = Account number\n
\n

In addition to the above, the IBAN is under development in countries below but has not yet been catalogued for general international use.[6][7]\n

In this list\n

\n
  • \"kk\" represent the IBAN checksum digits
  • \n
  • \"a\" represents an uppercase alpha character (A-Z)
  • \n
  • \"c\" represents an alphanumeric character (a\u2013z, A\u2013Z, 0\u20139)
  • \n
  • \"n\" represents a numeric character (0-9)
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Aspirational country codes for International Bank Account Number\n
Country\nChars\nBBAN format\nExample\n
Algeria\n26\n22n\nDZkk nnnn nnnn nnnn nnnn nnnn nn\n
Angola\n25\n21n\nAOkk nnnn nnnn nnnn nnnn nnnn n\n
Benin\n28\n2c, 22n\nBJkk ccnn nnnn nnnn nnnn nnnn nnnn\n
Burkina Faso\n28\n2c, 22n\nBFkk ccnn nnnn nnnn nnnn nnnn nnnn\n
Cabo Verde\n25\n21n\nCVkk nnnn nnnn nnnn nnnn nnnn n\n
Cameroon\n27\n23n\nCMkk nnnn nnnn nnnn nnnn nnnn nnn\n
Central African Republic\n27\n23n\nCFkk nnnn nnnn nnnn nnnn nnnn nnn\n
Chad\n27\n23n\nTDkk nnnn nnnn nnnn nnnn nnnn nnn\n
Comoros\n27\n23n\nKMkk nnnn nnnn nnnn nnnn nnnn nnn\n
Congo, Republic of the\n27\n23n\nCGkk nnnn nnnn nnnn nnnn nnnn nnn\n
C\u00f4te d'Ivoire\n28\n2a, 22n\nCIkk aann nnnn nnnn nnnn nnnn nnnn\n
Equatorial Guinea\n27\n23n\nGQkk nnnn nnnn nnnn nnnn nnnn nnn\n
Gabon\n27\n23n\nGAkk nnnn nnnn nnnn nnnn nnnn nnn\n
Guinea-Bissau\n25\n2c, 19n\nGWkk ccnn nnnn nnnn nnnn nnnn n\n
Iran[8]\n26\n22n\nIRkk nnnn nnnn nnnn nnnn nnnn nn\n
Madagascar\n27\n23n\nMGkk nnnn nnnn nnnn nnnn nnnn nnn\n
Mali\n28\n2c, 22n\nMLkk ccnn nnnn nnnn nnnn nnnn nnnn\n
Morocco\n28\n24n\nMAkk nnnn nnnn nnnn nnnn nnnn nnnn\n
Mozambique\n25\n21n\nMZkk nnnn nnnn nnnn nnnn nnnn n\n
Niger\n28\n2a, 22n\nNEkk aann nnnn nnnn nnnn nnnn nnnn\n
Senegal\n28\n2a, 22n\nSNkk aann nnnn nnnn nnnn nnnn nnnn\n
Togo\n28\n2a, 22n\nTGkk aann nnnn nnnn nnnn nnnn nnnn\n
\n
    \n
  1. ^ a b \"IBAN REGISTRY \u2013 This registry provides detailed information about all ISO 13616-compliant national IBAN formats. \u2013 Release 99 \u2013 December 2024\". SWIFT. December 2024. Retrieved 31 December 2024.\n
  2. \n
  3. ^ IBAN Implementation Guidelines for Brazil - Circular 3.625 (PDF). Banco Central do Brasil. 14 February 2013. Retrieved 1 August 2013.\n
  4. \n
  5. ^ \"2.65 PL - Poland\". IBAN Registry (PDF). SWIFT. December 2024. p. 72. Retrieved 16 September 2025.\n
  6. \n
  7. ^ \"IBAN - BIC\". Narodowy Bank Polski. Narodowy Bank Polski. Retrieved 16 September 2025.\n
  8. \n
  9. ^ \"Qatar\". IBAN Registry (PDF). SWIFT. November 2013. p. 63. Archived from the original (PDF) on 1 November 2013. Retrieved 21 November 2013.\n
  10. \n
  11. ^ \"IBAN countries\". Nordea. 2020. Archived from the original on 2 Apr 2016. Retrieved 13 August 2020.\n
  12. \n
  13. ^ \"IBAN Examples, Structure and Length\". IBAN. 28 July 2020. Retrieved 13 August 2020.\n
  14. \n
  15. ^ \"\u0645\u0634\u062e\u0635\u0627\u062a \u0645\u0644\u06cc \u0634\u0646\u0627\u0633\u0647 \u062d\u0633\u0627\u0628 \u0628\u0627\u0646\u06a9\u06cc \u0627\u06cc\u0631\u0627\u0646 (\u0634\u0628\u0627)\". 2021-05-18. Archived from the original on 2021-05-18. Retrieved 2024-07-18.{{cite web}}: CS1 maint: bot: original URL status unknown (link)\n
  16. \n


Cite error: There are <ref group=Note> tags on this page, but the references will not show without a {{reflist|group=Note}} template (see the help page).

\n\n\n
"},"langlinks":[{"lang":"af","url":"https://af.wikipedia.org/wiki/IBAN","langname":"Afrikaans","autonym":"Afrikaans","*":"IBAN"},{"lang":"ar","url":"https://ar.wikipedia.org/wiki/%D8%B1%D9%82%D9%85_%D8%A7%D9%84%D8%AD%D8%B3%D8%A7%D8%A8_%D8%A7%D9%84%D9%85%D8%B5%D8%B1%D9%81%D9%8A_%D8%A7%D9%84%D8%AF%D9%88%D9%84%D9%8A","langname":"Arabic","autonym":"\u0627\u0644\u0639\u0631\u0628\u064a\u0629","*":"\u0631\u0642\u0645 \u0627\u0644\u062d\u0633\u0627\u0628 \u0627\u0644\u0645\u0635\u0631\u0641\u064a \u0627\u0644\u062f\u0648\u0644\u064a"},{"lang":"az","url":"https://az.wikipedia.org/wiki/IBAN","langname":"Azerbaijani","autonym":"az\u0259rbaycanca","*":"IBAN"},{"lang":"be","url":"https://be.wikipedia.org/wiki/%D0%9C%D1%96%D0%B6%D0%BD%D0%B0%D1%80%D0%BE%D0%B4%D0%BD%D1%8B_%D0%BD%D1%83%D0%BC%D0%B0%D1%80_%D0%B1%D0%B0%D0%BD%D0%BA%D0%B0%D1%9E%D1%81%D0%BA%D0%B0%D0%B3%D0%B0_%D1%80%D0%B0%D1%85%D1%83%D0%BD%D0%BA%D1%83","langname":"Belarusian","autonym":"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f","*":"\u041c\u0456\u0436\u043d\u0430\u0440\u043e\u0434\u043d\u044b \u043d\u0443\u043c\u0430\u0440 \u0431\u0430\u043d\u043a\u0430\u045e\u0441\u043a\u0430\u0433\u0430 \u0440\u0430\u0445\u0443\u043d\u043a\u0443"},{"lang":"be-x-old","url":"https://be-tarask.wikipedia.org/wiki/%D0%9C%D1%96%D0%B6%D0%BD%D0%B0%D1%80%D0%BE%D0%B4%D0%BD%D1%8B_%D0%BD%D1%83%D0%BC%D0%B0%D1%80_%D0%B1%D0%B0%D0%BD%D0%BA%D0%B0%D1%9E%D1%81%D0%BA%D0%B0%D0%B3%D0%B0_%D1%80%D0%B0%D1%85%D1%83%D0%BD%D0%BA%D1%83","langname":"Belarusian (Tara\u0161kievica orthography)","autonym":"\u0431\u0435\u043b\u0430\u0440\u0443\u0441\u043a\u0430\u044f (\u0442\u0430\u0440\u0430\u0448\u043a\u0435\u0432\u0456\u0446\u0430)","*":"\u041c\u0456\u0436\u043d\u0430\u0440\u043e\u0434\u043d\u044b \u043d\u0443\u043c\u0430\u0440 \u0431\u0430\u043d\u043a\u0430\u045e\u0441\u043a\u0430\u0433\u0430 \u0440\u0430\u0445\u0443\u043d\u043a\u0443"},{"lang":"bg","url":"https://bg.wikipedia.org/wiki/%D0%9C%D0%B5%D0%B6%D0%B4%D1%83%D0%BD%D0%B0%D1%80%D0%BE%D0%B4%D0%B5%D0%BD_%D0%BD%D0%BE%D0%BC%D0%B5%D1%80_%D0%BD%D0%B0_%D0%B1%D0%B0%D0%BD%D0%BA%D0%BE%D0%B2%D0%B0_%D1%81%D0%BC%D0%B5%D1%82%D0%BA%D0%B0","langname":"Bulgarian","autonym":"\u0431\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438","*":"\u041c\u0435\u0436\u0434\u0443\u043d\u0430\u0440\u043e\u0434\u0435\u043d \u043d\u043e\u043c\u0435\u0440 \u043d\u0430 \u0431\u0430\u043d\u043a\u043e\u0432\u0430 \u0441\u043c\u0435\u0442\u043a\u0430"},{"lang":"ca","url":"https://ca.wikipedia.org/wiki/N%C3%BAmero_de_compte_bancari_internacional","langname":"Catalan","autonym":"catal\u00e0","*":"N\u00famero de compte bancari internacional"},{"lang":"cs","url":"https://cs.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Czech","autonym":"\u010de\u0161tina","*":"International Bank Account Number"},{"lang":"de","url":"https://de.wikipedia.org/wiki/Internationale_Bankkontonummer","langname":"German","autonym":"Deutsch","*":"Internationale Bankkontonummer"},{"lang":"et","url":"https://et.wikipedia.org/wiki/IBAN","langname":"Estonian","autonym":"eesti","*":"IBAN"},{"lang":"el","url":"https://el.wikipedia.org/wiki/%CE%94%CE%B9%CE%B5%CE%B8%CE%BD%CE%AE%CF%82_%CF%84%CF%81%CE%B1%CF%80%CE%B5%CE%B6%CE%B9%CE%BA%CF%8C%CF%82_%CE%BB%CE%BF%CE%B3%CE%B1%CF%81%CE%B9%CE%B1%CF%83%CE%BC%CF%8C%CF%82","langname":"Greek","autonym":"\u0395\u03bb\u03bb\u03b7\u03bd\u03b9\u03ba\u03ac","*":"\u0394\u03b9\u03b5\u03b8\u03bd\u03ae\u03c2 \u03c4\u03c1\u03b1\u03c0\u03b5\u03b6\u03b9\u03ba\u03cc\u03c2 \u03bb\u03bf\u03b3\u03b1\u03c1\u03b9\u03b1\u03c3\u03bc\u03cc\u03c2"},{"lang":"es","url":"https://es.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Spanish","autonym":"espa\u00f1ol","*":"International Bank Account Number"},{"lang":"eo","url":"https://eo.wikipedia.org/wiki/Internacia_bankkonta_numero","langname":"Esperanto","autonym":"Esperanto","*":"Internacia bankkonta numero"},{"lang":"fa","url":"https://fa.wikipedia.org/wiki/%D8%B4%D9%85%D8%A7%D8%B1%D9%87_%D8%AD%D8%B3%D8%A7%D8%A8_%D8%A8%D8%A7%D9%86%DA%A9%DB%8C_%D8%A8%DB%8C%D9%86%E2%80%8C%D8%A7%D9%84%D9%85%D9%84%D9%84%DB%8C","langname":"Persian","autonym":"\u0641\u0627\u0631\u0633\u06cc","*":"\u0634\u0645\u0627\u0631\u0647 \u062d\u0633\u0627\u0628 \u0628\u0627\u0646\u06a9\u06cc \u0628\u06cc\u0646\u200c\u0627\u0644\u0645\u0644\u0644\u06cc"},{"lang":"fr","url":"https://fr.wikipedia.org/wiki/International_Bank_Account_Number","langname":"French","autonym":"fran\u00e7ais","*":"International Bank Account Number"},{"lang":"ga","url":"https://ga.wikipedia.org/wiki/IBAN_(Uimhir_Idirn%C3%A1isi%C3%BAnta_Chuntas_Bainc)","langname":"Irish","autonym":"Gaeilge","*":"IBAN (Uimhir Idirn\u00e1isi\u00fanta Chuntas Bainc)"},{"lang":"ko","url":"https://ko.wikipedia.org/wiki/%EA%B5%AD%EC%A0%9C_%EC%9D%80%ED%96%89_%EA%B3%84%EC%A2%8C_%EB%B2%88%ED%98%B8","langname":"Korean","autonym":"\ud55c\uad6d\uc5b4","*":"\uad6d\uc81c \uc740\ud589 \uacc4\uc88c \ubc88\ud638"},{"lang":"hy","url":"https://hy.wikipedia.org/wiki/%D5%84%D5%AB%D5%BB%D5%A1%D5%A6%D5%A3%D5%A1%D5%B5%D5%AB%D5%B6_%D5%A2%D5%A1%D5%B6%D5%AF%D5%A1%D5%B5%D5%AB%D5%B6_%D5%B0%D5%A1%D5%B7%D5%BE%D5%A5%D5%B0%D5%A1%D5%B4%D5%A1%D6%80_(IBAN)","langname":"Armenian","autonym":"\u0570\u0561\u0575\u0565\u0580\u0565\u0576","*":"\u0544\u056b\u057b\u0561\u0566\u0563\u0561\u0575\u056b\u0576 \u0562\u0561\u0576\u056f\u0561\u0575\u056b\u0576 \u0570\u0561\u0577\u057e\u0565\u0570\u0561\u0574\u0561\u0580 (IBAN)"},{"lang":"hr","url":"https://hr.wikipedia.org/wiki/IBAN","langname":"Croatian","autonym":"hrvatski","*":"IBAN"},{"lang":"id","url":"https://id.wikipedia.org/wiki/Nomor_Rekening_Bank_Internasional","langname":"Indonesian","autonym":"Bahasa Indonesia","*":"Nomor Rekening Bank Internasional"},{"lang":"it","url":"https://it.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Italian","autonym":"italiano","*":"International Bank Account Number"},{"lang":"he","url":"https://he.wikipedia.org/wiki/%D7%9E%D7%A1%D7%A4%D7%A8_%D7%96%D7%94%22%D7%91","langname":"Hebrew","autonym":"\u05e2\u05d1\u05e8\u05d9\u05ea","*":"\u05de\u05e1\u05e4\u05e8 \u05d6\u05d4\"\u05d1"},{"lang":"kn","url":"https://kn.wikipedia.org/wiki/%E0%B2%85%E0%B2%82%E0%B2%A4%E0%B2%B0%E0%B2%B0%E0%B2%BE%E0%B2%B7%E0%B3%8D%E0%B2%9F%E0%B3%8D%E0%B2%B0%E0%B3%80%E0%B2%AF_%E0%B2%AC%E0%B3%8D%E0%B2%AF%E0%B2%BE%E0%B2%82%E0%B2%95%E0%B3%8D%E2%80%8C_%E0%B2%96%E0%B2%BE%E0%B2%A4%E0%B3%86_%E0%B2%B8%E0%B2%82%E0%B2%96%E0%B3%8D%E0%B2%AF%E0%B3%86","langname":"Kannada","autonym":"\u0c95\u0ca8\u0ccd\u0ca8\u0ca1","*":"\u0c85\u0c82\u0ca4\u0cb0\u0cb0\u0cbe\u0cb7\u0ccd\u0c9f\u0ccd\u0cb0\u0cc0\u0caf \u0cac\u0ccd\u0caf\u0cbe\u0c82\u0c95\u0ccd\u200c \u0c96\u0cbe\u0ca4\u0cc6 \u0cb8\u0c82\u0c96\u0ccd\u0caf\u0cc6"},{"lang":"ka","url":"https://ka.wikipedia.org/wiki/%E1%83%A1%E1%83%90%E1%83%94%E1%83%A0%E1%83%97%E1%83%90%E1%83%A8%E1%83%9D%E1%83%A0%E1%83%98%E1%83%A1%E1%83%9D_%E1%83%A1%E1%83%90%E1%83%91%E1%83%90%E1%83%9C%E1%83%99%E1%83%9D_%E1%83%90%E1%83%9C%E1%83%92%E1%83%90%E1%83%A0%E1%83%98%E1%83%A8%E1%83%98%E1%83%A1_%E1%83%9C%E1%83%9D%E1%83%9B%E1%83%94%E1%83%A0%E1%83%98","langname":"Georgian","autonym":"\u10e5\u10d0\u10e0\u10d7\u10e3\u10da\u10d8","*":"\u10e1\u10d0\u10d4\u10e0\u10d7\u10d0\u10e8\u10dd\u10e0\u10d8\u10e1\u10dd \u10e1\u10d0\u10d1\u10d0\u10dc\u10d9\u10dd \u10d0\u10dc\u10d2\u10d0\u10e0\u10d8\u10e8\u10d8\u10e1 \u10dc\u10dd\u10db\u10d4\u10e0\u10d8"},{"lang":"kk","url":"https://kk.wikipedia.org/wiki/IBAN","langname":"Kazakh","autonym":"\u049b\u0430\u0437\u0430\u049b\u0448\u0430","*":"IBAN"},{"lang":"lv","url":"https://lv.wikipedia.org/wiki/Starptautiskais_bankas_konta_numurs","langname":"Latvian","autonym":"latvie\u0161u","*":"Starptautiskais bankas konta numurs"},{"lang":"lt","url":"https://lt.wikipedia.org/wiki/IBAN","langname":"Lithuanian","autonym":"lietuvi\u0173","*":"IBAN"},{"lang":"hu","url":"https://hu.wikipedia.org/wiki/ISO_13616","langname":"Hungarian","autonym":"magyar","*":"ISO 13616"},{"lang":"my","url":"https://my.wikipedia.org/wiki/%E1%80%A1%E1%80%95%E1%80%BC%E1%80%8A%E1%80%BA%E1%80%95%E1%80%BC%E1%80%8A%E1%80%BA%E1%80%86%E1%80%AD%E1%80%AF%E1%80%84%E1%80%BA%E1%80%9B%E1%80%AC_%E1%80%98%E1%80%8F%E1%80%BA%E1%80%A1%E1%80%80%E1%80%B1%E1%80%AC%E1%80%84%E1%80%B7%E1%80%BA_%E1%80%94%E1%80%B6%E1%80%95%E1%80%AB%E1%80%90%E1%80%BA","langname":"Burmese","autonym":"\u1019\u103c\u1014\u103a\u1019\u102c\u1018\u102c\u101e\u102c","*":"\u1021\u1015\u103c\u100a\u103a\u1015\u103c\u100a\u103a\u1006\u102d\u102f\u1004\u103a\u101b\u102c \u1018\u100f\u103a\u1021\u1000\u1031\u102c\u1004\u1037\u103a \u1014\u1036\u1015\u102b\u1010\u103a"},{"lang":"nl","url":"https://nl.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Dutch","autonym":"Nederlands","*":"International Bank Account Number"},{"lang":"ja","url":"https://ja.wikipedia.org/wiki/IBAN%E3%82%B3%E3%83%BC%E3%83%89","langname":"Japanese","autonym":"\u65e5\u672c\u8a9e","*":"IBAN\u30b3\u30fc\u30c9"},{"lang":"no","url":"https://no.wikipedia.org/wiki/IBAN","langname":"Norwegian","autonym":"norsk","*":"IBAN"},{"lang":"pl","url":"https://pl.wikipedia.org/wiki/Mi%C4%99dzynarodowy_numer_rachunku_bankowego","langname":"Polish","autonym":"polski","*":"Mi\u0119dzynarodowy numer rachunku bankowego"},{"lang":"pt","url":"https://pt.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Portuguese","autonym":"portugu\u00eas","*":"International Bank Account Number"},{"lang":"ro","url":"https://ro.wikipedia.org/wiki/Num%C4%83r_Interna%C8%9Bional_de_Cont_Bancar","langname":"Romanian","autonym":"rom\u00e2n\u0103","*":"Num\u0103r Interna\u021bional de Cont Bancar"},{"lang":"ru","url":"https://ru.wikipedia.org/wiki/IBAN","langname":"Russian","autonym":"\u0440\u0443\u0441\u0441\u043a\u0438\u0439","*":"IBAN"},{"lang":"sq","url":"https://sq.wikipedia.org/wiki/IBAN","langname":"Albanian","autonym":"shqip","*":"IBAN"},{"lang":"simple","url":"https://simple.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Simple English","autonym":"Simple English","*":"International Bank Account Number"},{"lang":"sk","url":"https://sk.wikipedia.org/wiki/Medzin%C3%A1rodn%C3%A9_bankov%C3%A9_%C4%8D%C3%ADslo_%C3%BA%C4%8Dtu","langname":"Slovak","autonym":"sloven\u010dina","*":"Medzin\u00e1rodn\u00e9 bankov\u00e9 \u010d\u00edslo \u00fa\u010dtu"},{"lang":"sl","url":"https://sl.wikipedia.org/wiki/Mednarodna_%C5%A1tevilka_ban%C4%8Dnega_ra%C4%8Duna","langname":"Slovenian","autonym":"sloven\u0161\u010dina","*":"Mednarodna \u0161tevilka ban\u010dnega ra\u010duna"},{"lang":"sr","url":"https://sr.wikipedia.org/wiki/IBAN","langname":"Serbian","autonym":"\u0441\u0440\u043f\u0441\u043a\u0438 / srpski","*":"IBAN"},{"lang":"fi","url":"https://fi.wikipedia.org/wiki/IBAN","langname":"Finnish","autonym":"suomi","*":"IBAN"},{"lang":"sv","url":"https://sv.wikipedia.org/wiki/Internationellt_bankkontonummer","langname":"Swedish","autonym":"svenska","*":"Internationellt bankkontonummer"},{"lang":"roa-tara","url":"https://roa-tara.wikipedia.org/wiki/IBAN","langname":"Tarantino","autonym":"tarand\u00edne","*":"IBAN"},{"lang":"tr","url":"https://tr.wikipedia.org/wiki/IBAN","langname":"Turkish","autonym":"T\u00fcrk\u00e7e","*":"IBAN"},{"lang":"uk","url":"https://uk.wikipedia.org/wiki/International_Bank_Account_Number","langname":"Ukrainian","autonym":"\u0443\u043a\u0440\u0430\u0457\u043d\u0441\u044c\u043a\u0430","*":"International Bank Account Number"},{"lang":"ur","url":"https://ur.wikipedia.org/wiki/%D8%A7%D9%86%D9%B9%D8%B1%D9%86%DB%8C%D8%B4%D9%86%D9%84_%D8%A8%DB%8C%D9%86%DA%A9_%D8%A7%DA%A9%D8%A7%D8%A4%D9%86%D9%B9_%D9%86%D9%85%D8%A8%D8%B1","langname":"Urdu","autonym":"\u0627\u0631\u062f\u0648","*":"\u0627\u0646\u0679\u0631\u0646\u06cc\u0634\u0646\u0644 \u0628\u06cc\u0646\u06a9 \u0627\u06a9\u0627\u0624\u0646\u0679 \u0646\u0645\u0628\u0631"},{"lang":"yo","url":"https://yo.wikipedia.org/wiki/ISO_13616","langname":"Yoruba","autonym":"Yor\u00f9b\u00e1","*":"ISO 13616"},{"lang":"zh","url":"https://zh.wikipedia.org/wiki/%E5%9B%BD%E9%99%85%E9%93%B6%E8%A1%8C%E8%B4%A6%E6%88%B7%E5%8F%B7%E7%A0%81","langname":"Chinese","autonym":"\u4e2d\u6587","*":"\u56fd\u9645\u94f6\u884c\u8d26\u6237\u53f7\u7801"}],"categories":[{"sortkey":"","hidden":"","*":"CS1_maint:_bot:_original_URL_status_unknown"},{"sortkey":"","hidden":"","*":"Pages_with_reference_errors"},{"sortkey":"International Bank Account Number","hidden":"","*":"Pages_with_missing_references_list"}],"links":[{"ns":10,"exists":"","*":"Template:Cite web"},{"ns":0,"exists":"","*":"Albania"},{"ns":0,"exists":"","*":"Algeria"},{"ns":0,"exists":"","*":"Andorra"},{"ns":0,"exists":"","*":"Angola"},{"ns":0,"exists":"","*":"Austria"},{"ns":0,"exists":"","*":"Azerbaijan"},{"ns":0,"exists":"","*":"Bahrain"},{"ns":0,"exists":"","*":"Bankleitzahl"},{"ns":0,"exists":"","*":"Belarus"},{"ns":0,"exists":"","*":"Belgium"},{"ns":0,"exists":"","*":"Benin"},{"ns":0,"exists":"","*":"Bosnia and Herzegovina"},{"ns":0,"exists":"","*":"Brazil"},{"ns":0,"exists":"","*":"British Virgin Islands"},{"ns":0,"exists":"","*":"Bulgaria"},{"ns":0,"exists":"","*":"Burkina Faso"},{"ns":0,"exists":"","*":"Burundi"},{"ns":0,"exists":"","*":"Cabo Verde"},{"ns":0,"exists":"","*":"Cameroon"},{"ns":0,"exists":"","*":"Central African Republic"},{"ns":0,"exists":"","*":"Chad"},{"ns":0,"exists":"","*":"Comoros"},{"ns":0,"exists":"","*":"Costa Rica"},{"ns":0,"exists":"","*":"Croatia"},{"ns":0,"exists":"","*":"Cyprus"},{"ns":0,"exists":"","*":"Czech Republic"},{"ns":0,"exists":"","*":"C\u00f4te d'Ivoire"},{"ns":0,"exists":"","*":"Denmark"},{"ns":0,"exists":"","*":"Djibouti"},{"ns":0,"exists":"","*":"Dominican Republic"},{"ns":0,"exists":"","*":"East Timor"},{"ns":0,"exists":"","*":"Egypt"},{"ns":0,"exists":"","*":"El Salvador"},{"ns":0,"exists":"","*":"Equatorial Guinea"},{"ns":0,"exists":"","*":"Estonia"},{"ns":0,"exists":"","*":"Falkland Islands"},{"ns":0,"exists":"","*":"Faroe Islands"},{"ns":0,"exists":"","*":"Finland"},{"ns":0,"exists":"","*":"France"},{"ns":0,"exists":"","*":"Gabon"},{"ns":0,"exists":"","*":"Georgia (country)"},{"ns":0,"exists":"","*":"Germany"},{"ns":0,"exists":"","*":"Gibraltar"},{"ns":0,"exists":"","*":"Greece"},{"ns":0,"exists":"","*":"Greenland"},{"ns":0,"exists":"","*":"Guatemala"},{"ns":0,"exists":"","*":"Guinea-Bissau"},{"ns":0,"exists":"","*":"Honduras"},{"ns":0,"exists":"","*":"Hungary"},{"ns":0,"exists":"","*":"ISO 9362"},{"ns":0,"exists":"","*":"Iceland"},{"ns":0,"exists":"","*":"Iran"},{"ns":0,"exists":"","*":"Iraq"},{"ns":0,"exists":"","*":"Israel"},{"ns":0,"exists":"","*":"Italy"},{"ns":0,"exists":"","*":"Jordan"},{"ns":0,"exists":"","*":"Kazakhstan"},{"ns":0,"exists":"","*":"Kennitala"},{"ns":0,"exists":"","*":"Kosovo"},{"ns":0,"exists":"","*":"Kuwait"},{"ns":0,"exists":"","*":"Latvia"},{"ns":0,"exists":"","*":"Lebanon"},{"ns":0,"exists":"","*":"Libya"},{"ns":0,"exists":"","*":"Liechtenstein"},{"ns":0,"exists":"","*":"Lithuania"},{"ns":0,"exists":"","*":"Luxembourg"},{"ns":0,"exists":"","*":"Madagascar"},{"ns":0,"exists":"","*":"Mali"},{"ns":0,"exists":"","*":"Malta"},{"ns":0,"exists":"","*":"Mauritania"},{"ns":0,"exists":"","*":"Mauritius"},{"ns":0,"exists":"","*":"Moldova"},{"ns":0,"exists":"","*":"Monaco"},{"ns":0,"exists":"","*":"Mongolia"},{"ns":0,"exists":"","*":"Montenegro"},{"ns":0,"exists":"","*":"Morocco"},{"ns":0,"exists":"","*":"Mozambique"},{"ns":0,"exists":"","*":"Netherlands"},{"ns":0,"exists":"","*":"Nicaragua"},{"ns":0,"exists":"","*":"Niger"},{"ns":0,"exists":"","*":"Nordea"},{"ns":0,"exists":"","*":"North Macedonia"},{"ns":0,"exists":"","*":"Norway"},{"ns":0,"exists":"","*":"Oman"},{"ns":0,"exists":"","*":"Pakistan"},{"ns":0,"exists":"","*":"Palestinian territories"},{"ns":0,"exists":"","*":"Poland"},{"ns":0,"exists":"","*":"Portugal"},{"ns":0,"exists":"","*":"Qatar"},{"ns":0,"exists":"","*":"Republic of Ireland"},{"ns":0,"exists":"","*":"Republic of the Congo"},{"ns":0,"exists":"","*":"Romania"},{"ns":0,"exists":"","*":"Russia"},{"ns":0,"exists":"","*":"Saint Lucia"},{"ns":0,"exists":"","*":"San Marino"},{"ns":0,"exists":"","*":"Saudi Arabia"},{"ns":0,"exists":"","*":"Senegal"},{"ns":0,"exists":"","*":"Serbia"},{"ns":0,"exists":"","*":"Seychelles"},{"ns":0,"exists":"","*":"Slovakia"},{"ns":0,"exists":"","*":"Slovenia"},{"ns":0,"exists":"","*":"Somalia"},{"ns":0,"exists":"","*":"Sort code"},{"ns":0,"exists":"","*":"Spain"},{"ns":0,"exists":"","*":"Sudan"},{"ns":0,"exists":"","*":"Sweden"},{"ns":0,"exists":"","*":"Switzerland"},{"ns":0,"exists":"","*":"S\u00e3o Tom\u00e9 and Pr\u00edncipe"},{"ns":0,"exists":"","*":"Togo"},{"ns":0,"exists":"","*":"Tunisia"},{"ns":0,"exists":"","*":"Turkey"},{"ns":0,"exists":"","*":"Ukraine"},{"ns":0,"exists":"","*":"United Arab Emirates"},{"ns":0,"exists":"","*":"United Kingdom"},{"ns":0,"exists":"","*":"Vatican City"},{"ns":0,"exists":"","*":"Yemen"},{"ns":0,"*":"Code guichet"},{"ns":0,"*":"Cl\u00e9 RIB"},{"ns":0,"*":"Codice CIN"},{"ns":0,"*":"Codice ABI"},{"ns":0,"*":"Codice CAB"},{"ns":12,"exists":"","*":"Help:Cite errors/Cite error group refs without references"},{"ns":14,"exists":"","*":"Category:CS1 maint: bot: original URL status unknown"}],"templates":[{"ns":10,"exists":"","*":"Template:Color"},{"ns":10,"exists":"","*":"Template:Ifsubst"},{"ns":10,"exists":"","*":"Template:Color/styles.css"},{"ns":10,"exists":"","*":"Template:Ill"},{"ns":10,"exists":"","*":"Template:Interlanguage link"},{"ns":10,"exists":"","*":"Template:Separated entries"},{"ns":10,"exists":"","*":"Template:Main other"},{"ns":10,"exists":"","*":"Template:Cite web"},{"ns":10,"exists":"","*":"Template:Cite book"},{"ns":10,"exists":"","*":"Template:Broken ref"},{"ns":10,"exists":"","*":"Template:Broken ref/lang"},{"ns":10,"exists":"","*":"Template:Broken ref/cat"},{"ns":828,"exists":"","*":"Module:Separated entries"},{"ns":828,"exists":"","*":"Module:TableTools"},{"ns":828,"exists":"","*":"Module:Arguments"},{"ns":828,"exists":"","*":"Module:Citation/CS1"},{"ns":828,"exists":"","*":"Module:Citation/CS1/Configuration"},{"ns":828,"exists":"","*":"Module:Citation/CS1/Whitelist"},{"ns":828,"exists":"","*":"Module:Citation/CS1/Utilities"},{"ns":828,"exists":"","*":"Module:Citation/CS1/Date validation"},{"ns":828,"exists":"","*":"Module:Citation/CS1/Identifiers"},{"ns":828,"exists":"","*":"Module:Citation/CS1/COinS"},{"ns":828,"exists":"","*":"Module:Citation/CS1/styles.css"},{"ns":828,"exists":"","*":"Module:Namespace detect"},{"ns":828,"exists":"","*":"Module:Namespace detect/data"},{"ns":828,"exists":"","*":"Module:Namespace detect/config"},{"ns":828,"exists":"","*":"Module:Yesno"}],"images":[],"externallinks":["https://www.swift.com/resource/iban-registry-pdf","http://www.bcb.gov.br/Pom/Spb/Ing/IBAN-Guidelines_English.pdf","https://www.swift.com/sites/default/files/files/iban-registry_3.pdf","https://nbp.pl/en/statistic-and-financial-reporting/financial-markets/iban-bic/","https://web.archive.org/web/20131101223646/http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf","http://www.swift.com/dsp/resources/documents/IBAN_Registry.pdf","https://archive.today/20160402113645/http://www.nordea.com/en/our-services/cashmanagement/iban-validator-and-information/iban-countries/","http://www.nordea.com/en/our-services/cashmanagement/iban-validator-and-information/iban-countries/index.html","https://www.iban.com/structure.html","https://web.archive.org/web/20210518172456/https://bmi.ir/fa/pages/192/%D9%85%D8%B4%D8%AE%D8%B5%D8%A7%D8%AA%20%D9%85%D9%84%DB%8C%20%D8%B4%D9%86%D8%A7%D8%B3%D9%87%20%D8%AD%D8%B3%D8%A7%D8%A8%20%D8%A8%D8%A7%D9%86%DA%A9%DB%8C%20%D8%A7%DB%8C%D8%B1%D8%A7%D9%86%20(%D8%B4%D8%A8%D8%A7)"],"sections":[{"toclevel":1,"level":"3","line":"IBAN formats by country","number":"1","index":"1","fromtitle":"International_Bank_Account_Number","byteoffset":0,"anchor":"IBAN_formats_by_country","linkAnchor":"IBAN_formats_by_country"}],"parsewarnings":["Script warning: One or more {{[[Template:cite web|cite web]]}} templates have maintenance messages; messages may be hidden ([[Help:CS1_errors#Controlling_error_message_display|help]])."],"displaytitle":"International Bank Account Number","iwlinks":[{"prefix":"fr","url":"https://fr.wikipedia.org/wiki/Relev%C3%A9_d%27identit%C3%A9_bancaire","*":"fr:Relev\u00e9 d'identit\u00e9 bancaire"},{"prefix":"fr","url":"https://fr.wikipedia.org/wiki/cl%C3%A9_RIB","*":"fr:cl\u00e9 RIB"},{"prefix":"it","url":"https://it.wikipedia.org/wiki/Coordinate_bancarie","*":"it:Coordinate bancarie"}],"properties":[{"name":"wikibase_item","*":"Q144593"}]}} \ No newline at end of file diff --git a/src/IbanNet/Registry/Wikipedia/wiki.http b/src/IbanNet/Registry/Wikipedia/wiki.http new file mode 100644 index 00000000..78b81023 --- /dev/null +++ b/src/IbanNet/Registry/Wikipedia/wiki.http @@ -0,0 +1,11 @@ +# Fetch this API to get the latest IBAN registry data from Wikipedia. Place the JSON response body in a +# new file 'api-result-{RevId}.json' where {RevId} is the revision id of the page (this can be found in the +# response body. Then, update the attribute on the WikipediaRegistryProvider.Load method. On the next +# project rebuild, the new provider will be generated. +GET https://en.wikipedia.org/w/api.php?format=json&action=parse&page=International_Bank_Account_Number§ion=16 +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 + +### + +GET https://en.wikipedia.org/api/rest_v1/page/html/International_Bank_Account_Number +User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 From 102788ace45c4124e4ffde7e7c247496b95c0cf2 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Tue, 30 Sep 2025 05:03:11 +0200 Subject: [PATCH 6/7] chore: remove WikipediaPattern --- .../Wikipedia/IbanWikipediaPattern.cs | 15 --- .../Registry/Wikipedia/WikipediaPattern.cs | 37 -------- .../Patterns/PatternExtensionsTests.cs | 10 +- .../Wikipedia/IbanWikipediaPatternTests.cs | 16 ---- .../Wikipedia/WikipediaPatternTests.cs | 93 ------------------- 5 files changed, 7 insertions(+), 164 deletions(-) delete mode 100644 src/IbanNet/Registry/Wikipedia/IbanWikipediaPattern.cs delete mode 100644 src/IbanNet/Registry/Wikipedia/WikipediaPattern.cs delete mode 100644 test/IbanNet.Tests/Registry/Wikipedia/IbanWikipediaPatternTests.cs delete mode 100644 test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTests.cs diff --git a/src/IbanNet/Registry/Wikipedia/IbanWikipediaPattern.cs b/src/IbanNet/Registry/Wikipedia/IbanWikipediaPattern.cs deleted file mode 100644 index 36059e30..00000000 --- a/src/IbanNet/Registry/Wikipedia/IbanWikipediaPattern.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace IbanNet.Registry.Wikipedia; - -internal class IbanWikipediaPattern : WikipediaPattern -{ - public IbanWikipediaPattern(string countryCode, string pattern) - : base(countryCode + ",2n," + pattern) - { - } - - public override string ToString() - { - // strip country code, check digits tokens and separators, eg.: None[2], comma, Digit[2], comma. - return base.ToString().Substring(6); - } -} diff --git a/src/IbanNet/Registry/Wikipedia/WikipediaPattern.cs b/src/IbanNet/Registry/Wikipedia/WikipediaPattern.cs deleted file mode 100644 index 698c6b57..00000000 --- a/src/IbanNet/Registry/Wikipedia/WikipediaPattern.cs +++ /dev/null @@ -1,37 +0,0 @@ -using IbanNet.Registry.Patterns; - -namespace IbanNet.Registry.Wikipedia; - -internal class WikipediaPattern : Pattern -{ - private static readonly WikipediaPatternTokenizer Tokenizer = new(); - - public WikipediaPattern(string pattern) : base( -#if NETSTANDARD2_1_OR_GREATER || NET6_0_OR_GREATER - pattern?.Replace(",", null, StringComparison.Ordinal)!, -#else - pattern?.Replace(",", null)!, -#endif - Tokenizer - ) - { - } - - public override string ToString() - { - return string.Join(",", - Tokens.Select(t => t.Value ?? $"{t.MaxLength}{GetToken(t.Category)}") - ); - } - - private static char GetToken(AsciiCategory category) - { - return category switch - { - AsciiCategory.Digit => 'n', - AsciiCategory.UppercaseLetter => 'a', - AsciiCategory.AlphaNumeric => 'c', - _ => throw new InvalidOperationException() - }; - } -} diff --git a/test/IbanNet.Tests/Registry/Patterns/PatternExtensionsTests.cs b/test/IbanNet.Tests/Registry/Patterns/PatternExtensionsTests.cs index 1e651ab4..499c9aaf 100644 --- a/test/IbanNet.Tests/Registry/Patterns/PatternExtensionsTests.cs +++ b/test/IbanNet.Tests/Registry/Patterns/PatternExtensionsTests.cs @@ -263,7 +263,9 @@ public static IEnumerable GetTestCases() new(AsciiCategory.Space, 1, 2), new(AsciiCategory.Space, 1, 2), new(AsciiCategory.UppercaseLetter, 1, 2), - new(AsciiCategory.UppercaseLetter, 1, 2), + new(AsciiCategory.UppercaseLetter, 1, 3), + new("A"), + new("BC"), new(AsciiCategory.LowercaseLetter, 1, 2), new(AsciiCategory.LowercaseLetter, 1, 2), new(AsciiCategory.Letter, 1, 2), @@ -271,7 +273,7 @@ public static IEnumerable GetTestCases() new(AsciiCategory.AlphaNumeric, 1, 2), new(AsciiCategory.AlphaNumeric, 1, 2) }, - "^\\d{2,4} {2,4}[A-Z]{2,4}[a-z]{2,4}[a-zA-Z]{2,4}[a-zA-Z0-9]{2,4}$" + "^\\d{2,4} {2,4}[A-Z]{2,5}ABC[a-z]{2,4}[a-zA-Z]{2,4}[a-zA-Z0-9]{2,4}$" ]; // Compress mixed. @@ -285,6 +287,8 @@ public static IEnumerable GetTestCases() new(AsciiCategory.Space, 2, 2), new(AsciiCategory.UppercaseLetter, 1, 2), new(AsciiCategory.UppercaseLetter, 2, 2), + new("A"), + new("BC"), new(AsciiCategory.LowercaseLetter, 1, 2), new(AsciiCategory.LowercaseLetter, 2, 2), new(AsciiCategory.Letter, 1, 2), @@ -292,7 +296,7 @@ public static IEnumerable GetTestCases() new(AsciiCategory.AlphaNumeric, 1, 2), new(AsciiCategory.AlphaNumeric, 2, 2) }, - "^\\d{3,4} {3,4}[A-Z]{3,4}[a-z]{3,4}[a-zA-Z]{3,4}[a-zA-Z0-9]{3,4}$" + "^\\d{3,4} {3,4}[A-Z]{3,4}ABC[a-z]{3,4}[a-zA-Z]{3,4}[a-zA-Z0-9]{3,4}$" ]; } } diff --git a/test/IbanNet.Tests/Registry/Wikipedia/IbanWikipediaPatternTests.cs b/test/IbanNet.Tests/Registry/Wikipedia/IbanWikipediaPatternTests.cs deleted file mode 100644 index d894e544..00000000 --- a/test/IbanNet.Tests/Registry/Wikipedia/IbanWikipediaPatternTests.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace IbanNet.Registry.Wikipedia; - -public class IbanWikipediaPatternTests -{ - [Theory] - [InlineData("AB", "6a,4n,16c", "6a,4n,16c")] - [InlineData("XY", "16c4n6a", "16c,4n,6a")] - public void Given_pattern_when_calling_to_string_should_return_expected_pattern(string countryCode, string pattern, string expectedPattern) - { - // Act - var actual = new IbanWikipediaPattern(countryCode, pattern); - - // Assert - actual.ToString().Should().Be(expectedPattern); - } -} diff --git a/test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTests.cs b/test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTests.cs deleted file mode 100644 index bd89c45e..00000000 --- a/test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTests.cs +++ /dev/null @@ -1,93 +0,0 @@ -using IbanNet.Registry.Patterns; - -namespace IbanNet.Registry.Wikipedia; - -public class WikipediaPatternTests -{ - [Fact] - public void When_creating_with_null_pattern_it_should_throw() - { - string? pattern = null; - - // Act - Func act = () => new WikipediaPattern(pattern!); - - // Assert - act.Should() - .Throw() - .WithParameterName(nameof(pattern)); - } - - [Theory] - [InlineData("6a,4n,16c", "6a,4n,16c")] - [InlineData("16c4n6a", "16c,4n,6a")] - public void Given_pattern_when_calling_to_string_should_return_expected_pattern(string pattern, string expectedPattern) - { - // Act - var actual = new WikipediaPattern(pattern); - - // Assert - actual.ToString().Should().Be(expectedPattern); - } - - [Theory] - [MemberData(nameof(GetTestCases))] - public void Given_pattern_when_getting_tokens_it_should_return_expected(string pattern, IEnumerable expectedTokens) - { - // Act - var actual = new WikipediaPattern(pattern); - - // Assert - actual.Tokens.Should().BeEquivalentTo(expectedTokens); - } - - [Theory] - [InlineData("6a,4n,16c", true)] - [InlineData("4n", true)] - public void Given_pattern_when_getting_isFixedLength_it_should_return_expected(string pattern, bool expectedIsFixedLength) - { - // Act - var actual = new WikipediaPattern(pattern); - - // Assert - actual.IsFixedLength.Should().Be(expectedIsFixedLength); - } - - public static IEnumerable GetTestCases() - { - yield return - [ - "6a,4n,16c", - new List - { - new(AsciiCategory.UppercaseLetter, 6), - new(AsciiCategory.Digit, 4), - new(AsciiCategory.AlphaNumeric, 16) - } - ]; - - yield return - [ - "1n2a3c", - new List - { - new(AsciiCategory.Digit, 1), - new(AsciiCategory.UppercaseLetter, 2), - new(AsciiCategory.AlphaNumeric, 3) - } - ]; - } - - [Theory] - [InlineData("AD", "8n,12c", "^AD\\d{10}[a-zA-Z0-9]{12}$")] - [InlineData("NL", "4a,10n", "^NL\\d{2}[A-Z]{4}\\d{10}$")] - [InlineData("NO", "11n", "^NO\\d{13}$")] - [InlineData("PT", "21n", "^PT\\d{23}$")] - [InlineData("SM", "1a,10n,12c", "^SM\\d{2}[A-Z]\\d{10}[a-zA-Z0-9]{12}$")] - public void When_getting_regexPattern_it_should_return_expected(string countryCode, string wikiIbanPattern, string regexPattern) - { - var sut = new IbanWikipediaPattern(countryCode, wikiIbanPattern); - - sut.ToRegexPattern().Should().Be(regexPattern); - } -} From ac0168aaedfde820d7f47d66ac7b0ea81ffe8a76 Mon Sep 17 00:00:00 2001 From: skwasjer <11424653+skwasjer@users.noreply.github.com> Date: Thu, 2 Oct 2025 01:10:46 +0200 Subject: [PATCH 7/7] chore: move tokenizer implementations to codegen --- src/IbanNet.CodeGen/IbanNet.CodeGen.csproj | 2 -- .../PatternTokenizer.cs | 23 ++++--------------- .../Swift/SwiftPatternTokenizer.cs | 19 ++++----------- .../Wikipedia/WikipediaPatternTokenizer.cs | 4 +--- src/IbanNet/Resources.Designer.cs | 9 -------- src/IbanNet/Resources.ca.resx | 3 --- src/IbanNet/Resources.de.resx | 3 --- src/IbanNet/Resources.nl.resx | 3 --- src/IbanNet/Resources.resx | 3 --- .../Swift/SwiftPatternTokenizerTests.cs | 6 ++--- .../WikipediaPatternTokenizerTests.cs | 7 +++--- 11 files changed, 17 insertions(+), 65 deletions(-) rename src/{IbanNet/Registry/Patterns => IbanNet.CodeGen}/PatternTokenizer.cs (82%) rename src/{IbanNet/Registry => IbanNet.CodeGen}/Swift/SwiftPatternTokenizer.cs (66%) rename src/{IbanNet/Registry => IbanNet.CodeGen}/Wikipedia/WikipediaPatternTokenizer.cs (96%) rename test/{IbanNet.Tests/Registry => IbanNet.CodeGen.Tests}/Swift/SwiftPatternTokenizerTests.cs (93%) rename test/{IbanNet.Tests/Registry => IbanNet.CodeGen.Tests}/Wikipedia/WikipediaPatternTokenizerTests.cs (91%) diff --git a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj index 4e4f5efe..a8b8e2ba 100644 --- a/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj +++ b/src/IbanNet.CodeGen/IbanNet.CodeGen.csproj @@ -26,8 +26,6 @@ - - diff --git a/src/IbanNet/Registry/Patterns/PatternTokenizer.cs b/src/IbanNet.CodeGen/PatternTokenizer.cs similarity index 82% rename from src/IbanNet/Registry/Patterns/PatternTokenizer.cs rename to src/IbanNet.CodeGen/PatternTokenizer.cs index 2ffedc3f..2a8bbbd2 100644 --- a/src/IbanNet/Registry/Patterns/PatternTokenizer.cs +++ b/src/IbanNet.CodeGen/PatternTokenizer.cs @@ -1,7 +1,7 @@ -using System.Globalization; -using IbanNet.Extensions; +using IbanNet.Extensions; +using IbanNet.Registry.Patterns; -namespace IbanNet.Registry.Patterns; +namespace IbanNet.CodeGen; internal abstract class PatternTokenizer : ITokenizer { @@ -13,26 +13,17 @@ protected PatternTokenizer(Func partitionOn) } /// -#if USE_SPANS - public virtual IEnumerable Tokenize(ReadOnlySpan input) - { -#else public virtual IEnumerable Tokenize(IEnumerable input) { if (input is null) { throw new ArgumentNullException(nameof(input)); } -#endif return TokenizeIterator(input); } -#if USE_SPANS - private List TokenizeIterator(ReadOnlySpan input) -#else private List TokenizeIterator(IEnumerable input) -#endif { var tokenList = new List(8); var tokenCharList = new List(4); @@ -95,9 +86,7 @@ private PatternToken CreateToken(string token, int pos) if (asciiCategory == AsciiCategory.None || occurrences <= 0) { -#pragma warning disable RS1035 - throw new PatternException(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos)); -#pragma warning restore RS1035 + throw new PatternException($"The pattern token '{token}' is invalid at position {pos}."); } return new PatternToken(asciiCategory, isFixedLength ? occurrences : 1, occurrences); @@ -109,9 +98,7 @@ or FormatException and not PatternException or IndexOutOfRangeException ) { -#pragma warning disable RS1035 - throw new PatternException(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos), ex); -#pragma warning restore RS1035 + throw new PatternException($"The pattern token '{token}' is invalid at position {pos}.", ex); } } diff --git a/src/IbanNet/Registry/Swift/SwiftPatternTokenizer.cs b/src/IbanNet.CodeGen/Swift/SwiftPatternTokenizer.cs similarity index 66% rename from src/IbanNet/Registry/Swift/SwiftPatternTokenizer.cs rename to src/IbanNet.CodeGen/Swift/SwiftPatternTokenizer.cs index 6c124381..c56faf5a 100644 --- a/src/IbanNet/Registry/Swift/SwiftPatternTokenizer.cs +++ b/src/IbanNet.CodeGen/Swift/SwiftPatternTokenizer.cs @@ -2,7 +2,7 @@ using IbanNet.Extensions; using IbanNet.Registry.Patterns; -namespace IbanNet.Registry.Swift; +namespace IbanNet.CodeGen.Swift; /// /// https://www.swift.com/standards/data-standards/iban @@ -46,24 +46,13 @@ protected override int GetLength(string token, AsciiCategory category, out bool return -1; } -#if USE_SPANS - ReadOnlySpan lengthDescriptor = token.AsSpan(0, token.Length - 1); + string lengthDescriptor = token.Substring(0, token.Length - 1); // ReSharper disable once UseIndexFromEndExpression - isFixedLength = lengthDescriptor[^1] == '!'; + isFixedLength = lengthDescriptor[lengthDescriptor.Length - 1] == '!'; return int.Parse( - lengthDescriptor[..^Convert.ToByte(isFixedLength)], + lengthDescriptor.Substring(0, lengthDescriptor.Length - Convert.ToByte(isFixedLength)), NumberStyles.None, CultureInfo.InvariantCulture ); -#else - string lengthDescriptor = token.Substring(0, token.Length - 1); - // ReSharper disable once UseIndexFromEndExpression - isFixedLength = lengthDescriptor[lengthDescriptor.Length - 1] == '!'; - return int.Parse( - lengthDescriptor.Substring(0, lengthDescriptor.Length - Convert.ToByte(isFixedLength)), - NumberStyles.None, - CultureInfo.InvariantCulture - ); -#endif } } diff --git a/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs b/src/IbanNet.CodeGen/Wikipedia/WikipediaPatternTokenizer.cs similarity index 96% rename from src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs rename to src/IbanNet.CodeGen/Wikipedia/WikipediaPatternTokenizer.cs index 1c427b5d..975fa7d6 100644 --- a/src/IbanNet/Registry/Wikipedia/WikipediaPatternTokenizer.cs +++ b/src/IbanNet.CodeGen/Wikipedia/WikipediaPatternTokenizer.cs @@ -2,7 +2,7 @@ using IbanNet.Extensions; using IbanNet.Registry.Patterns; -namespace IbanNet.Registry.Wikipedia; +namespace IbanNet.CodeGen.Wikipedia; internal class WikipediaPatternTokenizer : PatternTokenizer { @@ -13,7 +13,6 @@ public WikipediaPatternTokenizer() { } -#if !USE_SPANS /// public override IEnumerable Tokenize(IEnumerable input) { @@ -25,7 +24,6 @@ public override IEnumerable Tokenize(IEnumerable input) // Filter out separators. return base.Tokenize(input.Where(ch => ch != ',')); } -#endif protected override AsciiCategory GetCategory(string token) { diff --git a/src/IbanNet/Resources.Designer.cs b/src/IbanNet/Resources.Designer.cs index f94e78ea..d43c4b70 100644 --- a/src/IbanNet/Resources.Designer.cs +++ b/src/IbanNet/Resources.Designer.cs @@ -267,15 +267,6 @@ internal static string PartitionOn_At_least_one_character_to_partition_on_is_req } } - /// - /// Looks up a localized string similar to The pattern token '{0}' is invalid at position {1}.. - /// - internal static string PatternException_Invalid_token_0_at_position_1 { - get { - return ResourceManager.GetString("PatternException_Invalid_token_0_at_position_1", resourceCulture); - } - } - /// /// Looks up a localized string similar to The registry has no providers.. /// diff --git a/src/IbanNet/Resources.ca.resx b/src/IbanNet/Resources.ca.resx index 79cddcfa..4ca0463a 100644 --- a/src/IbanNet/Resources.ca.resx +++ b/src/IbanNet/Resources.ca.resx @@ -128,9 +128,6 @@ L'IBAN conté caràcters no permesos a la posició del codi de país. - - El token del patró '{0}' no és vàlid a la posició {1}. - S'espera caràcter alfanumèric a la posició {0}, però s'ha trobat '{1}'. diff --git a/src/IbanNet/Resources.de.resx b/src/IbanNet/Resources.de.resx index 4858c4b6..e18da9ef 100644 --- a/src/IbanNet/Resources.de.resx +++ b/src/IbanNet/Resources.de.resx @@ -128,9 +128,6 @@ Die IBAN enthält unzulässige Zeichen an der Stelle, an der der Ländercode erwartet wird. - - Das Token '{0}' an Position {1} ist ungültig. - Erwartetes alphanumerisches Zeichen an Position {0}, aber '{1}' gefunden. diff --git a/src/IbanNet/Resources.nl.resx b/src/IbanNet/Resources.nl.resx index 59ac98ae..3378618c 100644 --- a/src/IbanNet/Resources.nl.resx +++ b/src/IbanNet/Resources.nl.resx @@ -147,9 +147,6 @@ De IBAN heeft ongeldige karakters op de positie waar een landcode wordt verwacht. - - Het teken '{0}' is invalide op positie {1}. - Een alfanumeriek teken werd verwacht op positie {0}, waar het was '{1}'. diff --git a/src/IbanNet/Resources.resx b/src/IbanNet/Resources.resx index d36de621..d883672f 100644 --- a/src/IbanNet/Resources.resx +++ b/src/IbanNet/Resources.resx @@ -128,9 +128,6 @@ The IBAN contains illegal characters in the position where the country code is expected. - - The pattern token '{0}' is invalid at position {1}. - Expected alphanumeric character at position {0}, but found '{1}'. diff --git a/test/IbanNet.Tests/Registry/Swift/SwiftPatternTokenizerTests.cs b/test/IbanNet.CodeGen.Tests/Swift/SwiftPatternTokenizerTests.cs similarity index 93% rename from test/IbanNet.Tests/Registry/Swift/SwiftPatternTokenizerTests.cs rename to test/IbanNet.CodeGen.Tests/Swift/SwiftPatternTokenizerTests.cs index df6c86b7..4a22af04 100644 --- a/test/IbanNet.Tests/Registry/Swift/SwiftPatternTokenizerTests.cs +++ b/test/IbanNet.CodeGen.Tests/Swift/SwiftPatternTokenizerTests.cs @@ -1,7 +1,7 @@ using System.Globalization; using IbanNet.Registry.Patterns; -namespace IbanNet.Registry.Swift; +namespace IbanNet.CodeGen.Swift; public class SwiftPatternTokenizerTests { @@ -50,7 +50,7 @@ public void Given_null_input_when_tokenizing_it_should_throw() [InlineData("2n3a", "12ABCD", false, 5)] public void Given_valid_pattern_without_countryCode_it_should_decompose_into_tests(string pattern, string value, bool expectedResult, int? expectedErrorPos) { - var fakePattern = new TestPattern(_sut.Tokenize(pattern)); + var fakePattern = new PatternWrapper(pattern, _sut); // Act var validator = new PatternValidator(fakePattern.Tokens, fakePattern.IsFixedLength); @@ -74,7 +74,7 @@ public void Given_invalid_pattern_when_tokenizing_it_should_throw(string pattern // Assert act.Should() .Throw() - .WithMessage(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos) + "*") + .WithMessage(string.Format(CultureInfo.CurrentCulture, $"The pattern token '{token}' is invalid at position {pos}.", token, pos) + "*") .Which.InnerException.Should() .BeNull(); } diff --git a/test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTokenizerTests.cs b/test/IbanNet.CodeGen.Tests/Wikipedia/WikipediaPatternTokenizerTests.cs similarity index 91% rename from test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTokenizerTests.cs rename to test/IbanNet.CodeGen.Tests/Wikipedia/WikipediaPatternTokenizerTests.cs index 636f508c..1bc43911 100644 --- a/test/IbanNet.Tests/Registry/Wikipedia/WikipediaPatternTokenizerTests.cs +++ b/test/IbanNet.CodeGen.Tests/Wikipedia/WikipediaPatternTokenizerTests.cs @@ -1,7 +1,8 @@ using System.Globalization; +using IbanNet.CodeGen.Swift; using IbanNet.Registry.Patterns; -namespace IbanNet.Registry.Wikipedia; +namespace IbanNet.CodeGen.Wikipedia; public class WikipediaPatternTokenizerTests { @@ -47,7 +48,7 @@ public void Given_null_input_when_tokenizing_it_should_throw() [InlineData("2n3a", "12ABCD", false, 5)] public void Given_valid_pattern_without_countryCode_it_should_decompose_into_tests(string pattern, string value, bool expectedResult, int? expectedErrorPos) { - var fakePattern = new TestPattern(_sut.Tokenize(pattern)); + var fakePattern = new PatternWrapper(pattern, _sut); // Act var validator = new PatternValidator(fakePattern.Tokens, fakePattern.IsFixedLength); @@ -71,6 +72,6 @@ public void Given_invalid_pattern_when_tokenizing_it_should_throw(string pattern // Assert act.Should() .Throw() - .WithMessage(string.Format(CultureInfo.CurrentCulture, Resources.PatternException_Invalid_token_0_at_position_1, token, pos) + "*"); + .WithMessage(string.Format(CultureInfo.CurrentCulture, $"The pattern token '{token}' is invalid at position {pos}.", token, pos) + "*"); } }