Registration and License Formats

Regular expressions are pattern matching rules, and Determination uses them to evaluate whether certain types of tax configuration or transaction data matches a particular format (mask). For example, some tax authorities mandate registration formats by specifying masks.

You can see a list of all registration masks currently in Determination, with an explanation of the format, and see examples of each. See Determination Registration Masks, in the Knowledge Base, for more information.

The following table lists common meta-characters used in Determination authority registration masks (for a more detailed list, see the link in the note above). If you create license masks, or registration masks for your custom authorities, you can also use standard regular expressions not listed here (such as + and ?). A registration mask may include up to 100 characters.

Character

Definition

\

Either of the following:

  • For characters that are usually treated literally, indicates that the next character is special and is not interpreted literally. For example, d matches the character 'd'. By placing a backslash in front of d, (\d), the character becomes special (match a digit).
  • For characters that usually have special meaning, indicates that the next character is not special and should be interpreted literally. For example, * is a special character that means 0 or more occurrences of the preceding character should be matched; for example, a* means match 0 or more as. To match * literally, precede it with a backslash; for example, a\* matches 'a*'.

^

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 nine 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 nine digits.

|

The pipe symbol enables a match to either the string to the right or to the left of the pipe.

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})

A number of the preceding character to match.

For example, ZZ\d{9} indicates ZZ followed immediately by nine digits.

[xyz]

A character set. Matches any one of the enclosed characters. You can specify a range of characters by using a hyphen.

For example, EU[ab]$ matches EUa or EUb.

The following shows the registration validation expression for Germany. Germany requires a nine-digit registration number preceded by DE, Germany's EU country code. For example, DE123456789. Alpha characters are disallowed in the string:

^DE\d{9}$

  • ^ means that the beginning of the string must be here.
  • DE is the prefix for Germany.
  • \d represents a digit character.
  • {9} means that there have to be exactly nine of the previous character.
  • $ means that the end of the string must come here.

For example: DE123456789.