|
Purpose |
Wild card search for pattern in string | |
|
Syntax |
int pattern_match(pattern, pat_length, data, | |
|
Parameters |
char *pattern |
Pointer to characters for which to search |
|
|
int pat_length |
Length of pattern |
|
|
char *data |
Data in which to search for the pattern |
|
|
int data_length |
Length of the data |
|
Description |
The pattern_match() function does a wild card match for the parameter pattern in the parameter data. The matching is done using the following rules:
| |
|
Return values |
Returns TRUE if the pattern matches the data parameter | |
|
Example |
Here are some example patterns: "R*" matches data beginning with R (but not r) "*R" matches data for which the last non-blank character is an R "?R*" matches data whose second letter is an R "A*b" matches data beginning with A and ending with b | |