7.67.52015-05-06

Capture Field Masks

When using a Field Type of Custom or Regular Expression, the mask to be used must be set with a Field Mask.

To open the Mask List

  1. Create a new Capture Field Area
  2. Set the Capture Field Type to User Area
  3. Set the Field Style to Multi-Area Field
  4. Change the Mask Type to either Custom or Regular Expression.
  5. Next to the Format List, click the Edit Masks button.

To add a new mask to the list

  1. Click on the button to add a new entry.
  2. Double-click in the Name box and enter a name for the expression.
  3. Double-click in the Value box and enter the desired expression (see below).

Custom Masks

Custom masks are not as powerful as regular expressions but they offer two distinct advantages. First, Custom masks will automatically divide the Multi-Area Field in which they are used into the correct number of expected boxes and any static characters used in the mask will output in the Capture Field Box when printing. Second, Custom masks are simpler to use and have a one-on-one relationship between the mask and its output.

Accepted Characters

Each character, except for \, is deemed to be a single expected character, so the number of captured characters is not variable

Examples

These examples should clarify how the accepted characters should be used:

Mask Description Examples
\(999\)999\-9999 Canadian phone number with the area code (514)875-5863
(800)555-1234
\(999\)999\-9999\ \E\x\t\.999 Canadian phone number with area code and extension (514)875-5863 Ext.123
(800)555-1234 Ext.432
\+9\(999\)999\-9999 Canada/US phone number including area code and country code. +1(800)555-1234
\P\R\O\D\-XXXXX\-AAA\-99999 A product number made of 5 alphanumerical characters, 3 letters and then 5 numbers. PROD-5G32B-ADE-23643
PROD-IPHON-TGS-16000
999\-9999 A Japanese postal code, which is digits only 325-6731
812-2298
99999 A 5-digit US zip code 90210
32454
A9A\ 9A9 A Canadian postal code

H0H 0H0
J0S 1J0
H1V 2C8

\$999\,999\.99 Dollar amount with thousand separator, up to $999,999.99 dollars. However, note that all characters must be present, so the mask must be padded with zeroes (0) if the amount does not fully fill each box (see examples)

$000,001.99

$321,443.54

$000,599.97

 

It is important to understand that these masks are very precise and will not accept any sort of variation. For example, the second example (phone number with extension) will only accept a 3-digit extension. A 5-digit extension could not be entered with this mask. Because the Multi-Area Field will automatically divide the field into boxes accepting one character per box, this is made clear to anyone using these boxes.

Regular Expressions

If the data that is expected from the field can vary in contents as well as length, a Regular Expression can be used instead of a Custom mask. Regular expressions are much more powerful but they can be difficult to understand at first. Note that a Regular Expression mask will not automatically divide the Multi-Area Field into rows and columns nor will it print out static characters in the field, since the number of characters can be variable.

Accepted Values

This documentation cannot pretend to teach anyone how to learn to use Regular Expressions nor to describe how to build regular expressions. Plenty of tutorials and documentation on Regular Expressions exist online. However, here are some quick resources that may help you in building your expressions:

These links are provided for your education and are not supported or maintained by Objectif Lune Inc.. Use the information provided by those links at your own risk.

Examples

These examples are similar to the ones in the Custom Mask but may extend upon them and accept a wider variety of results.

Regular Expression Description Examples
(\d{3})\D*(\d{3})\D*(\d{4})\D*(\d*)$ A fully featured expression for most phone number formats used in the world. work 1-(800) 555.1212 #1234
800-555-1212
80055512121234
PROD-[0-9A-Za-z]{5}-[A-Z]{3}-\d{5} Product Number PROD-5G32B-ADE-23643
PROD-IPHON-TGS-16000
^\d{5}(-\d{4})?$ A 5 or 9 digit US Zip code with optional dash. 90210
32454-4332
^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$ A valid Canadian postal code. H0H 0H0
J0S 1J0
H1V 2C8