module Europe::Vat::Format

Defined in:

europe/vat/format.cr

Constant Summary

VAT_REGEX = {"AT" => /^ATU\d{8}$/, "BE" => /^BE0\d{9}$/, "BG" => /^BG(\d{10}|\d{9})$/, "CY" => /^CY\d{8}[A-Z]$/, "CZ" => /^CZ(\d{8}|\d{9}|\d{10})$/, "DE" => /^DE\d{9}$/, "DK" => /^DK\d{2} \d{2} \d{2} \d{2}$/, "EE" => /^EE\d{9}$/, "EL" => /^EL\d{9}$/, "ES" => /^ES([A-Z0-9]\d{7}[A-Z0-9])$/, "FI" => /^FI\d{8}$/, "FR" => /^FR[A-Z0-9][A-Z0-9] \d{9}$/, "GB" => [/^GB(\d{3} \d{4} \d{2}( \d{3}5)?)$/, /^GB(HA|GD)\d{3}(6|7)$/], "HR" => /^HR\d{11}$/, "HU" => /^HU\d{8}$/, "IE" => /^IE\d[A-Z0-9\+\*|\d]\d{5}([A-Z]|WI)$/, "IT" => /^IT\d{11}$/, "LT" => /^LT(\d{9}|\d{12})$/, "LU" => /^LU\d{8}$/, "LV" => /^LV\d{11}$/, "MT" => /^MT\d{8}$/, "NL" => /^NL\d{9}B\d\d$/, "PL" => /^PL\d{10}$/, "PT" => /^PT\d{9}$/, "RO" => /^RO\d{2,10}$/, "SE" => /^SE\d{12}$/, "SI" => /^SI\d{8}$/, "SK" => /^SK\d{10}$/}

Class Method Summary

Class Method Detail

def self.match_vat_number(number : String, country_code : String) #

[View source]
def self.sanitize_number(number : String, country_code : String) #

[View source]
def self.validate(number : String) #

[View source]