HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)

Chapter 4 153
Advanced Forms Design
PATTERN MATCH
pattern can span more than one line if it is enclosed within braces {}. If a pattern is within
braces, it is terminated by the first blank outside the braces.
The match pattern can include specific characters in addition to the types listed above. To
illustrate:
MATCH Aaa-ddd
This pattern means that the value must start with the letter A, be followed by any two
upper or lowercase letters of the alphabet, followed by a hyphen and then three digits. For
example, the value Acs-123 or AAA-999 are acceptable, but the values Bcs-999 or A12-345
are not.
Transparency
A special operator can be used to indicate that a pattern character is to be used as an
actual value. For example, suppose you want the lowercase letter a to be an exact value in
the pattern. You can do this by preceding it, or any of the other special pattern characters,
with an exclamation point (!). For example:
MATCH !addd \Value must start with the letter "a"
\followed by any three digits.
The exclamation point (called the transparency user) is also used to allow inclusion of any
of the pattern operators listed below, and described in Table 4-2.
! (tranparency)
, (choice)
: (range)
{} (grouping)
[] (optional)
+ (repetition — 1 or more)
* (repetition — 0 or more)
Choice
You can indicate a selection of acceptable patterns as part of the MATCH pattern. Each
possible choice is separated by a comma (,). For example:
MATCH A,AB,BCD,ddd \The characters "A", "AB", "BCD",
\or any three digits are acceptable.
Range
A range of acceptable characters for a single character position can be indicated with the
colon (:). All characters within the range are acceptable. This acts as a shorthand for
listing a series of single characters in USASCII sequence. For example:
MATCH C:J This is equivalent to the pattern specified by MATCH
C,D,E,F,G,H,I,J.
MATCH 1:7 Any of the digits 1,2,3,4,5,6, or 7 is accepted by this