A wildcard character is used to represent a character or a group of characters in a search expression. For example, the asterisk (*) typically represents one or more characters, and the question mark (?) typically represents a single character.
FOOD-TRAK supports a subset of regular expression search format. A regular expression is a combination of literal and wildcard characters that you use to find patterns of text. The literal text characters indicate text that must exist in the target string of text. The wildcard characters indicate the text that can vary in the target string.
The following wildcard characters are supported in the FOOD-TRAK application.
The asterisk (*) matches any series of characters. If the asterisk is followed by another character, the search will return results for any number of characters that appear before that character. A search term with a trailing asterisk returns all values that begin with the search term. A search term surrounded by two asterisks returns all values that contain that search term.
Examples:
Rye* returns:
”r;Rye Seasoning”
*Rye returns:
”r;Bread, Rye”
”r;Crackers, Rye”
*Rye* returns:
”r;Bread, Rye”
”r;Rye Seasoning”
”r;Crackers, Rye”
”r;Crackers, Rye and Flax”
The question mark (?) returns results for any one character between two or more search terms. For example, b?tter may return Butter and Batter since it matches any character between b and tter.
[x-y,z] This wildcard returns items within a range identified using the hyphen, or items beginning with the letters separated by commas. The square brackets [ ] are used to specify this type of search. The asterisk (*) and question mark (?) wildcard characters cannot be placed within the within the brackets. Other wildcards, if desired, must be placed outside the brackets. For example, to search for all items beginning with a, e, and j, enter the search expression [a,e,j]* as the search term. To find all items beginning with the letters a through c and the letter m, enter a search term [a-c,m]*. Without the asterisk, Find would search for item names only one letter long.
[^x-y,z] Used with the asterisk or question mark, this wildcard does the opposite of the one above. The caret character (^) excludes items that are a part of the search criteria within the square brackets. An asterisk must be placed after the closing bracket to return names longer than one letter. For example, to find all items except those beginning with the letters c through f, enter the wildcard as
[^c-f]* and those entries will be excluded.