I need to check the vat number.
xxxx.xxx.xxx → 0123.456.789 - a valid number.
I found a regex
^(BE)[0-1]{1}[0-9]{9}$|^((BE)|(BE ))[0-1]{1}(\d{3})([.]{1})(\d{3})([.]{1})(\d{3})
This will confirm the following entry: BE 0123.456.789.
But I only need to check xxxx.xxx.xxx (nothing is invalid, only this)
So 4 digits, dot, 3 digits, dot, 3 digits.
It should also start with 0 or 1 (first x → 0 or 1)
Sven source
share