The 0.5 release happened on 2/15, not on 2/14. :-)
[python/dscho.git] / Doc / lib / libfnmatch.tex
blob7d974611383a02a884ce9fc7a5e0f576aa013374
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}
19 \end{list}
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
25 segments).
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()}
35 instead.
36 \end{funcdesc}
38 \begin{funcdesc}{fnmatchcase}{filename, pattern}
39 Test whether \var{filename} matches \var{pattern}, returning true or
40 false; the comparision is case-sensitive.
41 \end{funcdesc}
44 \begin{seealso}
45 \seemodule{glob}{Shell-style path expansion}
46 \end{seealso}