Since the Spanish VAT pattern allows multiple combinaisons (with the regex pipe "|"), it looks like the regex accept any string if only the beginning of the string is matching any of the possible patterns.
This means that the validator will consider those examples as valid:
Since the Spanish VAT pattern allows multiple combinaisons (with the regex pipe "|"), it looks like the regex accept any string if only the beginning of the string is matching any of the possible patterns.
This means that the validator will consider those examples as valid:
ESB1234567C
ES12345678D
ESE12345678
but also those ones:
ESB1234567C_insert_here_anything
ES12345678D_the_end_will_never_be_checked
ESE12345678_wink_wink
Here's a patch to avoid this problem.