SMATCH Function

Syntax

Match_Flag as L = SMATCH(C string_1,C pattern)

Arguments

string_1

The character string to compare to the pattern. Character

pattern

A character string.

Description

Returns TRUE if the string matches the pattern (which can include wildcards).

Discussion

Returns .T. (TRUE) if pattern matches string_1. Either parameter can be a constant, character variable, or an expression that returns a character value. SMATCH() returns TRUE only if the entire string_1 matches the pattern. SMATCH() is useful for selecting records using query selection criteria, filter expressions, or conditional expressions. Note : Either character string parameter can include a Memo field. However, only the first 1024 characters of the Memo field are searched. Use SMATCH_MEMO() to search an entire Memo field.

Example

? smatch("alpha ", "alpha*")
= .T.
? smatch("alpha ", "alpha")
= .F.
? smatch("Beta", "beta")
= .T.
? smatch("alpha ", "alpha  ")
= .F.

See Also