Substring Search
Using the REGEX ComparisonOperator, character string properties can be searched for a match of a character string pattern within the property character string.
The following describes the search string value:
Example
Using the following settings in a CMetaFilterInfo object:
filterInfo.Filter.SetPropertyID(PID_NAME);
filterInfo.Filter.SetString(_T(“%Pres%”));
filterInfo.SetComparisonOperator(REGEX);
The MDS function will return objects with the following names:
VicePresident
President
PresidentElect
Elvis Presley
Example
Changing the search string to:
filterInfo.Filter.SetString(_T(“P%”));
The MDS function will return all objects with the names beginning with the character ‘P’:
Peterson
Powell
Pruitt
Example
Changing the search string to:
filterInfo.Filter.SetString(_T(“_a%”));
Uses the % and _ characters to select a list of names with the letter A as the second letter in the name. The length of the name returned may be two or more characters. The function will return objects with the following names:
Marston
Watson
Car
If the example used _a_, the search would be for a three-character string name with the letter a as the second character. In this case, the only object returned is:
Car