MATCH
Syntax
MATCH (Text Expression or Text Cube, Pattern, {Case Sensitive}, {Match Type}})
Description
The MATCH function returns True if Text Expression or Text Cube matches Pattern.
Pattern can be any of the following:
-
A text value in quotes (for example, "hello").
-
A data cube with a Text format.
-
The VALUE function, as in VALUE("Name").
If Case Sensitive is omitted or zero, the function ignores case. If Case Sensitive is nonzero, the function performs a case sensitive match.
Match Type can be one of these values:
-
0: Text contains Pattern.
-
1: Text matches Pattern exactly.
-
2: Text begins with Pattern.
-
3: Text ends with Pattern.
If the Match Type argument is omitted, it is assumed to be zero (text contains Pattern).
Returns
True if Text Expression or Text Cube matches Pattern.
Example
Suppose that Title = "A Quick Brown Fox" and Pattern = "brown." These results occur:
-
MATCH(Title, "A quick brown fox")returns True. (Case Sensitive argument is omitted, so the case does not have to match.) -
MATCH(Title, "a quick brown fox", 1)returns False. (Case Sensitive argument is 1, and the case does not match.) -
MATCH(Title, "A Quick Brown", 1, 1)returns False. (Match Type argument is 1, and the pattern does not match exactly.) -
MATCH(Title, "brown")returns True. (Title contains Brown.) -
MATCH(Title, Pattern)returns True. (Pattern equals brown, and Title contains the word Brown.) -
MATCH(Title, "a quick", 0, 2)returns True. (Title begins with A Quick.) -
MATCH(Title, "fox", 0, 2)returns False. (Title does not begin with fox.) -
MATCH(Title, "fox", 0, 3)returns True. (Title ends with Fox.) -
MATCH(LEFT(Title, 6), "Brown Fox", 1, 2)returns False (Title does not begin with Brown Fox.) -
MATCH(MID(Title, 0, 7), "A Quick", 1)returns True (Title contains A Quick.) -
MATCH(RIGHT(Title, 9), "Brown Fox", 1, 3)returns True (Title ends with Brown Fox.)