Pythonic way to handle vat number validation
<p>I have a case where I want to validate an entered vat number. Each European country has a pre-defined format and I can create a regex pattern to validate an entered number.</p>

<p>My question is what would be the most "pythonic" way to handle this for 20 countries. Should I create a dictionary with each of the country and its pattern</p>

<p>Example</p>

<pre><code>VAT_PATTERNS = {
   'ES': '([A-Z0-9][0-9]{7}[A-Z0-9]$)',
   'DE': '([0-9]{9}$)',
}
</code></pre>

<p>or is there a more pythonic way? </p>

<p>There are cases where several countries have the same pattern. Some countries might also have more complex patterns.</p>

<p>I could create a VAT base class from where each country's class inherits and handle it that way but that seems a bit out of place.</p>
