What patterns are available for variables in the Template Studio?

Patterns are used to define how certain fields can be entered by your users in the templates you create.

In the Template Studio you can set a variable for your templates as 'Single line pattern'. Here we explain the many options for patterns and how to use them correctly.
Patterns (or masks) are commonly used for business card phone numbers. If this variable is a free field, your users can fill in their phone numbers in any way they like and this can result in inconsistent designs. Using a pattern can prevent this by defining exactly where spaces should be used and the characters that can be filled in.

Examples of patterns for phone numbers are:
+1 (000) 000-0000
+31 6 00 00 00 00
\0\049 00 00000-0000

Of course, it can also be used for other variables like dates or bank accounts:
00-00-2\000
aa00 aaaa 0000 0000 00


These patterns have the following definitions:

  • 0 - any digit
  • a - any letter
  • * - any character
  • \ - used to make one of the characters above (0, a, or *) fixed
Furthermore, the following methods can be used to define more complex patterns: 
  • [] - make input optional
  • {} - include a fixed part in an unmasked value
  • ` - prevent symbols from shifting back
Any other characters that are not in these custom definitions will always be fixed.