Apply Mask Function

The apply mask function allows you to match a pattern in a string; that is, each character in a mask is tested against the corresponding character in the input string.

The mask is applied to a string on a character by character basis so that each character in the string is compared to its corresponding character in the mask, ensuring it is the correct type of character for that position, such as a digit, a letter, or a specific character, and so on. If the mask character used is specified as 'required', the character in the input string must be present and the character type must correspond to the mask character. If the mask character used is specified as 'optional', the character in the input string is valid against the mask if it is the expected character type or if it is left blank. A character is considered to be blank if it is a space (' ') or an underscore ('_').

The following table describes the effect of a character in a mask string:

Mask CharacterMeaningDescription
0required digitAny digit.
9optional digitAny digit.
#optional digitAny digit; also matches the + and - characters.
Lrequired letterAny letter.
?optional letterAny letter.
&required characterAny non-control* character.
Coptional characterAny non-control* character.
Arequired alphanumericAny letter or digit.
aoptional alphanumericAny letter or digit.
<shift downFlags mask to ensure that all letters that follow are lowercase, if matched by a mask character. This does not apply to literals.
>shift upFlags mask to ensure that all letters that follow are uppercase, if matched by a mask character. This does not apply to literals.
|cancel shiftCancels any shift up or shift down effect. All letters that follow may be either upper or lowercase.
\escapeEscapes a mask character, turning it into a literal.
Tip: You can use this feature on the following characters only: 0, 9, #, L, ?, &, C, A, a, <, >, |, or \
Otherrequired literalsThe corresponding character in the input string must exactly match the character.

* Control characters include all non-printing and formatting characters, such as line feeds and carriage returns.