Based on information provided by European Commission (source: http://ec.europa.eu/taxation_customs/vies/technicalInformation.html) "The European Commission cannot divulge these algorithms. However, the structure of VAT identification numbers is given and used here for the testing of the validations"
based on https://regex101.com/library/Pb0sAf