TACL Reference Manual

Built-In Functions and Variables
HP NonStop TACL Reference Manual429513-018
9-258
#MATCH Built-In Function
#MATCH Built-In Function
Use #MATCH to determine whether a particular text string satisfies the rules for a
template.
template
is a character sequence that may include these template characters:
text
is a character sequence to be compared to template.
Result
#MATCH returns -1 if the text satisfies the rules for the template; otherwise, it returns
0.
Considerations
The comparison is not case-sensitive; that is, an uppercase character is equal to
its lowercase counterpart.
template cannot contain spaces; text can contain spaces, but TACL construes
text with spaces as a space-separated list of multiple arguments. TACL examines
only the first argument and ignores the rest. For example, if the variable LINE
contains a line of text, you can use:
[#IF [#MATCH BEGIN [line]] |THEN| ... ]
to determine whether the first word in the line is “begin” (uppercase or lowercase is
not a factor).
To compare one string with another string, use the #COMPAREV built-in function.
(Strings can contain embedded spaces.).
#MATCH template [ text ]
* matches zero or more characters
? matches a single character
Note. Use of a large number of wild-card characters (*,?) can use significant processor
resources.