1 \section{\module{fnmatch
} ---
2 \UNIX{} filename pattern matching
}
4 \declaremodule{standard
}{fnmatch
}
5 \modulesynopsis{\UNIX{} shell style filename pattern matching.
}
8 This module provides support for
\UNIX{} shell-style wildcards, which
9 are
\emph{not
} the same as regular expressions (which are documented
10 in the
\refmodule{re
}\refstmodindex{re
} module). The special
11 characters used in shell-style wildcards are:
12 \index{filenames!wildcard expansion
}
14 \begin{list
}{}{\leftmargin 0.5in
\labelwidth 0.45in
}
15 \item[\code{*
}] matches everything
16 \item[\code{?
}] matches any single character
17 \item[\code{[}\var{seq
}\code{]}] matches any character in
\var{seq
}
18 \item[\code{[!
}\var{seq
}\code{]}] matches any character not in
\var{seq
}
21 Note that the filename separator (
\code{'/'
} on
\UNIX{}) is
\emph{not
}
22 special to this module. See module
23 \refmodule{glob
}\refstmodindex{glob
} for pathname expansion
24 (
\refmodule{glob
} uses
\function{fnmatch()
} to match filename
28 \begin{funcdesc
}{fnmatch
}{filename, pattern
}
29 Test whether the
\var{filename
} string matches the
\var{pattern
}
30 string, returning true or false. If the operating system is
31 case-insensitive, then both parameters will be normalized to all
32 lower- or upper-case before the comparision is performed. If you
33 require a case-sensitive comparision regardless of whether that's
34 standard for your operating system, use
\function{fnmatchcase()
}
38 \begin{funcdesc
}{fnmatchcase
}{filename, pattern
}
39 Test whether
\var{filename
} matches
\var{pattern
}, returning true or
40 false; the comparision is case-sensitive.
45 \seemodule{glob
}{Shell-style path expansion
}