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

Mexican RFC regex update #154

Closed pixelead0 closed 1 year ago

pixelead0 commented 5 years ago

^(([ÑA-Z|ña-z|&]{3}|[A-Z|a-z]{4})\d{2}((0[1-9]|1[012])(0[1-9]|1\d|2[0-8])|(0[13456789]|1[012])(29|30)|(0[13578]|1[02])31)(\w{2})([A|a|0-9]{1}))$|^(([ÑA-Z|ña-z|&]{3}|[A-Z|a-z]{4})([02468][048]|[13579][26])0229)(\w{2})([A|a|0-9]{1})$

For validated date YYYY-MM-DD

source: https://gist.github.com/gerardorochin/5718313

arthurdejong commented 4 years ago

Thanks and sorry for taking so long to respond.

I think this is already basically the regexp that is in use, see stdnum.mx.rfc.validate(). The biggest difference is that in python-stdnum the regexp is split up because the number is parsed to extract the type and do other validations.

If you know of any numbers that are not correctly validated, please let me know.

arthurdejong commented 1 year ago

Closing this for now. If there are any numbers that are not correctly validated, feel free to re-open this issue.