3.5.7.26 Match

Description

This function compares the string find$ with another string within$ to see whether their contents match with each other. It returns 1 (True, match) or 0 (False, not match). Note that wildcard characters "*" and "?" are supported in the find$ string variable, in any combination and number. Optionally you can use case sensitive check, the option Case controls case sensitivity: 0 (default) = false, 1 = true.

Syntax

int Match(within$, find$ [, Case])

NOTE: Order of string arguments is reverse of MS Excel's Search and Find functions.

Parameters

within$

is the containing string.

find$

is the string pattern you want to find.

Case

[optional] integer that specifies whether the function is case sensitive or not. The default value is 0 or false, which means the function is not case sensitive unless n is set to 1.

Return

If the string pattern has been found, return 1 (True).

If the string pattern has not been found, return 0 (False).

Note : Match does not support searches for raw characters ? or *. To search a string for ? or *, use the Compare function (which does not support wildcards).

Example

string str1$ = "From: test@Originlab.com";
string str2$ = "F*com";
int result = Match(str1$,str2$);
result = ; //should return 1
string str1$ = "From: test@Originlab.com";
string str2$ = "F*c?m";
int result = Match(str1$,str2$);
result = ; //should also return 1
int result = Match("ABC","A?C");
result =; //should return 1
int result = Match("ABC","AB");
result =; //should return 0

See Also

MatchBegin, MatchEnd, Search, Find, Compare