HP Data Entry and Forms Management System (VPLUS) Reference Manual (32209-90024)
156 Chapter4
Advanced Forms Design
PATTERN MATCH
Example
Some further examples of the MATCH statement are:
MATCH 1dddd Accepts an integer between 10000 and 19999. Could also
be expressed as: IN 10000:19999.
MATCH [d]d!:dd [AM,PM] Accepts a time such as 3:00 PM or 12:00.
MATCH {1:9,1(0:2}}!:
{0:5}db*[{A,P}
[M]] Accepts 12-hour clock time, such as 12:15 PM or 01:30 AM.
MATCH {1:7}{0:7} * Accepts an octal number greater than zero with at least
one digit and no leading zeros, such as 2047, or 1 or 24.
MATCH ddd-dd-dddd Accepts any United States Social Security number, such as
044-24-0474.
MATCH [(ddd)]b*ddd- dddd Accepts a United States phone number with an optional
area code.
Table 4-5. Pattern Match Operators
Operator Function Example
Exclamation
point
!
Transparency operator that allows use
of any specialMATCHcharactersas an
element in the pattern.
MATCH !u,!d,!,, accepts any of the
values u, d,,, or !.
Comma
,
Choice of subpatterns,any one of which
satisfies the match.
MATCH A,B, dd accepts values such as
A,B, and 22.
Colon: Rangeofsingle charactersin ascending
collating order, any one of which
satisfies the match.
MATCH 2:6 accepts only the values
2,3,4,5, or 6.
Braces
{}
Required grouping that specifies at
least one occurrence of any pattern
within braces.
MATCH {A,B}dd{%,d} accepts A223,
B34%,A795, and so forth.
Brackets
[ ]
Optional grouping that allows zero or
one occurrence of any item in pattern
within brackets.
MATCH [A,B]dd[%,d] accepts 24,A99,
10%,123, and so forth.
Plus
+
Required repetition that specifies at
least one or more occurrences of a
preceding item, or a pattern within
braces.
MATCH Xd+ accepts values such as
X1,X22, X3334789, and so forth, but
not X. MATCH {d,a} + accepts values
such as 11,A23,acb, or 33ABC9.
Asterisk
*
Optional repetition that allows zero or
more occurrences of a preceding item
or a pattern within braces.
MATCH Xd* accepts values such as
X,X1, X22, and X3334789. MATCH
{d,a}* accepts a null value, or such
values as 11,A23,acb, or 33ABC9.