COE (Codice operatore economico, San Marino national tax number).
The COE is a tax identification number of up to 5-digits used in San Marino. Leading zeroes are commonly dropped.
>>> validate('51')
'51'
>>> validate('024165')
'24165'
>>> validate('2416A')
Traceback (most recent call last):
...
InvalidFormat: ...
>>> validate('1124165')
Traceback (most recent call last):
...
InvalidLength: ...
Traceback (most recent call last):
...
InvalidLength: ...
Convert the number to the minimal representation. This strips surrounding whitespace and separation dash.
Checks to see if the number provided is a valid number. This checks the length, formatting and check digit.
Checks to see if the number provided is a valid number. This checks the length and formatting.