Registration and license formats
Some tax authorities mandate registration and/or license formats by specifying masks.
Determination uses regular expressions, which are pattern matching rules, to evaluate whether certain types of tax configuration or transaction data match a particular format (referred to as a mask).
This table lists common meta-characters used in Determination authority registration masks. You can create registration and/or license masks for your custom authorities. If you create masks for custom authorities, you can also use standard regular expressions (such as + and ?), which aren't listed in the table.
A registration mask can include up to 100 characters.
Character | Definition |
|---|---|
\ | Indicates one of the following:
|
^ | Indicates the beginning of the license or registration mask. For example, ^DE indicates that the license or registration must begin with DE. |
\d | Indicates a digit. Often used in conjunction with the {n} expression to indicate a number of digits. For example, \d{9} indicates 9 digits. |
\s | Indicates a hard space. For example, AT\sU indicates the string, AT U. |
$ | Indicates the end of the license or registration mask. For example, \d{9}$ indicates that the license or registration must end with 9 digits. |
| | Enables a match to either the string to the right or to the left of the pipe symbol (|). For example, ^ZZ\d{9}$|^EU$ indicates that a valid registration or license could be either ZZ123456789 (or ZZ plus any combination of nine digits) or EU. |
{n} (example: {2}) | Indicates a number of the preceding character to match. For example, ZZ\d{9} indicates ZZ followed immediately by 9 digits. |
[xyz] | Indicates a character set and matches any one of the enclosed characters. For example, >EU[ab]$ matches EUa or EUb. You can specify a range of characters using a hyphen. |
This table includes the registration validation expression for Germany. Germany requires DE (the EU country code for Germany) followed by a 9-digit registration number. Alpha characters are disallowed in the string.
Registration validation expression | Explanation |
|---|---|
^DE\d{9}$ |
|