arthurdejong / python-stdnum

A Python library to provide functions to handle, parse and validate standard numbers.
https://arthurdejong.org/python-stdnum/
GNU Lesser General Public License v2.1
498 stars 206 forks source link

Add regex to validate the correct format of CUIT #181

Closed eamanu closed 4 years ago

eamanu commented 4 years ago

According to #179 not any (2 digits) prefix are accepted on argentinian CUIT. So I added an Regex to validate correctly the CUIT's format.

arthurdejong commented 4 years ago

Hi @eamanu,

Thanks for your patch. I've only added the checking of the first two digits and not the checking for the place of the dashes. These kind of separators are generally ignored in python-stdnum because for a lot of numbers their placement is not very well defined.

I've merged your change as 0b30c4b and also ensured that the correct exception is raised (InvalidComponent).

eamanu commented 4 years ago

@arthurdejong thanks!