# VerifyString

The VerifyString function is used to verify the string and generate a pass/fail output.

Inputs

Parameter | Description
String | Specifies a text string or reference to a spreadsheet cell that contains a text string.
Field String | Specifies the number of characters contained in the character string and provides information about what characters are expected at different positions in the string.
Field Definitions | Optionally, the Field Definitions setting can be used to create user-defined entries for the Field String. When included in the Field String, these entries restrict the list of valid characters at the positions in which they are inserted.

### Field String

A Field String entry can be any alphanumeric character, including (A to Z), (a to z), (0 to 9), dashes(-), dots (.), and spaces ( ).

Each character in the Field String corresponds to an indexed field position. The Field String must contain at least the same number of positions as there are characters in the string for the string verification to pass (for example, if there are 10 characters present, but the Field String only specifies 9 characters, the best matching 9 are returned. However, if there are 8 characters present and the Field String defines 9 characters, the function returns #ERR). By default, each position in the Field String is represented as an asterisk (*) character, or alphanumeric "wildcard." This means that any character is valid at any position in the string.

The pre-defined Field String entries are:

Field String Entry | Description | Valid Characters
* | Wildcard | Any trained character in the font.
N | Numeric | 0123456789
A | Uppercase alphabetical | ABCDEFGHIJKLMNOPQRSTUVWXYZ
a | Lowercase alphabetical | abcdefghijklmnopqrstuvwxyz
H | Hexadecimal, uppercase alphabetical and numerical | 0123456789ABCDEF
h | Hexadecimal, lowercase alphabetical and numerical | 0123456789abcdef
O | Octal | 01234567

Field String Examples:

- Example 1: If the Field String is **********AN, any character in the font is valid in the first 10 Field String positions. But in the 11th position, only uppercase alpha characters are considered during the verification. And in the 12th position, only numeric characters are considered.

- Example 2: The font contains only numeric characters 0-9 and /. If the Field String is NN/NN/NN, only numeric characters are considered in the first and second, fourth and fifth, and seventh and eighth positions. Only the forward slash (/) character is considered in the third and sixth positions.

  But if the Field String is NN/NN/AA, the string verification returns #ERR because the font does not contain any alpha characters.

### Field Definitions

Optionally, the Field Definitions settings can be used to create user-defined entries for the Field String. When included in the Field String, these entries restrict the list of valid characters at the positions in which they are inserted.

You can overwrite the predefined definitions by adding a new definition to this field. For example, if the value of Field definition is A=A, only the A character is considered as a valid character because the Field Definition A=A overwrites the predefined Field String entry.

Field Definitions Examples:

- Example 1: If the value of Field Definitions is #=123;$=3456;%=789, and the Field String is #$%*******, then the only characters that are valid in the first position will be 1, 2, or 3. The only valid characters in the second position are 3, 4, 5, or 6. And in the third position, only 7, 8, or 9 are valid. Any character in the font is valid in the fourth through 10th positions.
- Example 2: If the value of Field Definitions is #=123;$=3456;%=789, A=A, and the Field String is #$%******A, then the only characters that are valid in the first position are 1, 2, or 3. The only valid characters in the second position are 3, 4, 5, or 6. And in the third position, only 7, 8, or 9 are valid. Any character in the font is valid in the fourth through ninth positions. Only the A character is considered in the 10th position because the Field Definition A=A remaps the predefined Field String entry.

Outputs

Returns | The pass/fail status of the string in the referenced Text data structure, or #ERR if any of the input parameters are invalid. 0 = Fail 1 = Pass