Wildcard characters are used to match, different systems on the same wildcard characters,
For example, there is an "_" Wildcard in SQL (instead of one character only) and a "%" wildcard (instead of one or more characters) and must be used with the link operator.
Only wildcard * and, are considered here. , * represents 0 or any number of characters. Represents a single character.
Match int (char *pat,char *str)
{
Switch (*PAT) {
Case ' I ' return!*str;
Case ' * ' return match (PAT+1,STR) | | *str&&match (pat,str+1);
Case '? ' Return *str&&match (pat+1,str+1);
Default return *pat==*str&&match (Pat+1,str=1);
}
}
Call Mathch ("A*B.C", "ALKLB.C") returns 1;
Note the difference from regular expressions:
Wildcard characters are used for matching.
A regular expression (regular expression) is a logical formula for string manipulation, which is used to match a string, consisting of a "rule string" with a predefined set of characters, and a combination of these particular characters, and this "rule string" A filter logic used to express a string, in short, can be regarded as a string matching pattern standard is a description and regulation of the string matching pattern