Skip to content

Commit

Permalink
Improve upon the Ireland VAT regex (fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphje committed Dec 31, 2016
1 parent eeb8083 commit b8adc79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internationalflavor/vat_number/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'GB': r'^(\d{9}|\d{12}|GD\d{3}|HA\d{3})$',
'HR': r'^\d{11}$',
'HU': r'^[0-9]{8}$',
'IE': r'^\d[A-Za-z0-9]\d{5}[A-Za-z]$',
'IE': r'^(\d[A-Z0-9]\d{5}[A-Z]|\d{7}[A-Z]{2})$',
'IT': r'^\d{11}$',
'LT': r'^(\d{9}|\d{12})$',
'LU': r'^\d{8}$',
Expand Down
4 changes: 3 additions & 1 deletion tests/test_vat_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class VATNumberTestCase(TestCase):

'BE 0203.201.340': 'BE0203201340',

'HU99999999': 'HU99999999'
'HU99999999': 'HU99999999',
'IE1234567XX': 'IE1234567XX',
'IE1X23456X': 'IE1X23456X',
}
invalid = {
'NL820646661B01': ['This VAT number does not match the requirements for NL.'],
Expand Down

0 comments on commit b8adc79

Please sign in to comment.