Pattern Matching
The Find Method and the MultipleFind Method use Pattern Matching to specify search
criteria when attempting to find entities.
A very simple method of pattern matching based on an SQL method is used. There
are two wildcard characters:
-
_ (underscore)
Used to match any single character
-
% (percent symbol)
Used to match any string of zero or more characters
If you wish to search for either of these wildcard characters as literal
characters, surround them in [] (square brackets).
Examples
-
To search for a string at the beginning of a field value use, for example, Arm%.
This could produce results such as Armstrong and Armitage.
-
To search for a string at the end of a field value use, for example, %ton.
This could produce results such as Hampton and Arlington.
-
To search for a string within a field value use, for example, %it%.
This could produce results such as Smith and Armitage.
-
To search for different spellings of the same name use, for example, Sm_th.
This could produce results such as Smith and Smyth.
-
To search for an email address containing an underscore character use, for
example, %[_]%@notquiteright.com. This could produce results
such as brian_march@notquiteright.com and andy_winters@notquiteright.com.