Specifications
Matching text patterns
626 InfoMaker
Matching text patterns
A text pattern is an expression that you can use to evaluate whether a string
contains a particular pattern of characters. Text patterns consist of
metacharacters, which have special meaning, and characters
(nonmetacharacters). The way the metacharacters and normal characters are
combined specify the pattern you are looking for.
Metacharacters
Valid metacharacters are:
• ^ (caret)
• $ (dollar sign)
•. (period)
• \ (backslash)
• [ ] (brackets)
•* (asterisk)
•+ (plus)
• ? (question mark)
Nonmetacharacters
In a text pattern, you can also use characters that are not metacharacters. One
or more nonmetacharacters in a text pattern (such as letters) match the
characters themselves. For example, A matches A, and ABC matches ABC.
Examples
Text patterns are needed in all expressions that use the Match function. Text
patterns are used in validation rules in the Form painter (in a column object’s
Validation property page) and the Database painter (in the Match Pattern dialog
box). For information about the Match function, see Match on page 702.
The following table shows various text patterns and sample text that matches
each pattern:
Table 23-13: Matching text patterns in InfoMaker expressions
This pattern Matches
AB Any string that contains AB; for example, ABA, DEABC,
graphAB_one.
B* Any string that contains 0 or more Bs; for example, AC, B, BB,
BBB, ABBBC, and so on.
AB*C Any string containing the pattern AC or ABC or ABBC, and so
on (0 or more Bs).
AB+C Any string containing the pattern ABC or ABBC or ABBBC,
and so on (1 or more Bs).