Field format (compact)

With custom fields, and some buyer fields, you can specify the field format using regular expressions or a compact format that is specific to Kofax AP Essentials. When you specify the field format, you determine how many characters of a certain type are allowed. You can specify the compact field format, for example, using the format C(f-t), where C stands for the type of character, f stands for "length from" and t stands for "length to". Spaces are not allowed in the format specification.

In contrast to regular expressions, which are only used for validation, the compact field format is used during extraction to help find the correct field.

You can also specify the field format for these predefined fields:

  • BuyerContactPersonName

  • BuyerContactReference

  • InvoiceOrderNumber

  • LIT_OrderNumber

Symbol Meaning Example
N Numeric characters Example: N(7)

Meaning: A seven-digit numeric field.

Field: 1234567

A Alphabetic characters Example: A(2-5)

Meaning: An alphabetic field containing two to five characters.

Field: Abc

X Alphanumeric characters and special characters such as "#", ">", etc. Example: X(5)

Meaning: A field containing five characters, each of which can be a letter, number, or a special character.

Field: Abc3D

W White space Example: N(3)WN(2)

Meaning: A field containing three digits, a space, and two more digits.

Field: 123 45

- Remove specific characters at the beginning or end of a string Example: N(4)-X(0-1)[#]

Meaning: The # character, if any, is removed when this four-digit Field is transferred.

Field: 1234#

Output: 1234

^ Disallowed character Example: N[^0]

Meaning: Any single digit except 0.

Field: 2

( ) Required Example: A(5)

Meaning: The field must contain five alphabetic characters.

Field: Abcde

[ ] Specified character (case sensitive) Example: N[139]

Meaning: A single digit that can be 1, 3, or 9.

Field: 3

{ } Multiple formats Example: {N(5)|N(10)}

Meaning: Either a five-digit field or a ten-digit field.

Field: 12345

| The "or" operator used to separate multiple formats when more than one is allowed Example: {N(5)|N(10)}

Meaning: Either a five-digit field or a ten-digit field.

Field: 1234567890

By using brackets, you can limit the valid characters in a format specification.


Compact format Meaning
N[1357] One digit: 1, 3, 5, or 7.
N[1357](3) Three digits, each of which can be 1, 3, 5, or 7.
X[#]N[4] A "#" character and then 4.
X[AaBb] One character: A, a, B, or b.

An exclusion symbol, "^", is available to disallow invalid characters. In order to disallow characters, the "^" symbol must be in the first position of the string. All characters following the "^" are disallowed.

If the "^" is not at the beginning of the string, then "^" is a valid character.


Compact format Meaning
A[^QVZ] Any letter of the alphabet except Q, V, or Z.
X[^*](2-4) Two to four characters; not an asterisk.
X[ #<^] One of three possible characters: "#", "<", or "^".
X[ #<^135] One of six possible characters: "#", "<", "^", 1, 3, or 5.
X[ #<^^] An invalid specification.