ppnnmmaattcchh() -- String Function (libc)

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;

ppnnmmaattcchh() matches _s_t_r_i_n_g with  _p_a_t_t_e_r_n, which is a regular expression.  The
shell  sshh  uses  patterns  for  file  name  expansion  and  ccaassee  statement
expressions.

ppnnmmaattcchh() returns one  if _p_a_t_t_e_r_n matches _s_t_r_i_n_g, and zero  if it does not.
Each  character  in  _p_a_t_t_e_r_n must  exactly  match  a  character in  _s_t_r_i_n_g;
however, the wildcards `*', `?', `['  and `]', and `[!' and `]' can be used
in _p_a_t_t_e_r_n to expand the range of matching.

_f_l_a_g must be either zero or  one: zero means that _p_a_t_t_e_r_n must match _s_t_r_i_n_g
exactly, whereas  one means that _p_a_t_t_e_r_n  can match any part  of _s_t_r_i_n_g. In
the latter case, the wildcards `' and `$' can also be used in _p_a_t_t_e_r_n.

_E_x_a_m_p_l_e
For an example of this function, see the entry for ffggeettss().

_S_e_e _A_l_s_o
eeggrreepp, ggrreepp, lliibbcc, sshh, ssttrriinngg.hh, wwiillddccaarrddss

_N_o_t_e_s
_f_l_a_g must be zero or one for ppnnmmaattcchh() to yield predictable results.

ppnnmmaattcchh() is  a more  powerful version of  the ANSI functions  ssttrrssttrr() and
ssttrrccmmpp().

For an  eeggrreepp-style version of ppnnmmaattcchh(), see the  function rreeggeexxpp(). It is
described in the Lexicon article lliibbmmiisscc.
