pnmatch() String Function pnmatch() Match string pattern int pnmatch(string, pattern, flag) char *string, *pattern; int flag; pnmatch matches string with pattern, which is a regular expres- sion. The shell sh uses patterns for file name expansion and case statement expressions. pnmatch returns one if pattern matches string, and zero if it does not. Each character in pattern must exactly match a charac- ter in string; however, the wildcards `*', `?', `[', and `]' can be used in pattern to expand the range of matching. flag must be either zero or one: zero means that pattern must match string exactly, whereas one means that pattern can match any part of string. In the latter case, the wildcards `^' and `$' can also be used in pattern. ***** Example ***** For an example of this function, see the entry for fgets. ***** See Also ***** egrep, general functions, grep, sh ***** Notes ***** flag must be zero or one for pnmatch to yield predictable results. pnmatch is a more powerful version of the ANSI functions strstr and strcmp. COHERENT Lexicon Page 1