

pnmatch()                String Function                pnmatch()




Match string pattern

iinntt ppnnmmaattcchh(_s_t_r_i_n_g, _p_a_t_t_e_r_n, _f_l_a_g)
cchhaarr *_s_t_r_i_n_g, *_p_a_t_t_e_r_n; iinntt _f_l_a_g;

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 ffggeettss.

***** 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


