summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libfnmatch.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-04-03 20:13:55 (GMT)
committerFred Drake <fdrake@acm.org>2000-04-03 20:13:55 (GMT)
commit38e5d27caee56b6958e0034e342abb48e6100390 (patch)
tree6a0c853da853123dd2e628e8ec187517250c2530 /Doc/lib/libfnmatch.tex
parent659ebfa79e891fc5e2480cd66c157970df57c451 (diff)
downloadcpython-38e5d27caee56b6958e0034e342abb48e6100390.zip
cpython-38e5d27caee56b6958e0034e342abb48e6100390.tar.gz
cpython-38e5d27caee56b6958e0034e342abb48e6100390.tar.bz2
Merged changes from the 1.5.2p2 release.
(Very rough.)
Diffstat (limited to 'Doc/lib/libfnmatch.tex')
-rw-r--r--Doc/lib/libfnmatch.tex29
1 files changed, 16 insertions, 13 deletions
diff --git a/Doc/lib/libfnmatch.tex b/Doc/lib/libfnmatch.tex
index 7d97461..527358b 100644
--- a/Doc/lib/libfnmatch.tex
+++ b/Doc/lib/libfnmatch.tex
@@ -5,42 +5,45 @@
\modulesynopsis{\UNIX{} shell style filename pattern matching.}
+\index{filenames!wildcard expansion}
+
This module provides support for \UNIX{} shell-style wildcards, which
are \emph{not} the same as regular expressions (which are documented
in the \refmodule{re}\refstmodindex{re} module). The special
characters used in shell-style wildcards are:
-\index{filenames!wildcard expansion}
-\begin{list}{}{\leftmargin 0.5in \labelwidth 0.45in}
-\item[\code{*}] matches everything
-\item[\code{?}] matches any single character
-\item[\code{[}\var{seq}\code{]}] matches any character in \var{seq}
-\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
-\end{list}
+\begin{tableii}{c|l}{code}{Pattern}{Meaning}
+ \lineii{*}{matches everything}
+ \lineii{?}{matches any single character}
+ \lineii{[\var{seq}]}{matches any character in \var{seq}}
+ \lineii{[!\var{seq}]}{matches any character not in \var{seq}}
+\end{tableii}
Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not}
special to this module. See module
\refmodule{glob}\refstmodindex{glob} for pathname expansion
-(\refmodule{glob} uses \function{fnmatch()} to match filename
-segments).
+(\refmodule{glob} uses \function{fnmatch()} to match pathname
+segments). Similarly, filenames starting with a period are
+not special for this module, and are matched by the \code{*} and
+\code{?} patterns.
\begin{funcdesc}{fnmatch}{filename, pattern}
Test whether the \var{filename} string matches the \var{pattern}
string, returning true or false. If the operating system is
case-insensitive, then both parameters will be normalized to all
-lower- or upper-case before the comparision is performed. If you
-require a case-sensitive comparision regardless of whether that's
+lower- or upper-case before the comparison is performed. If you
+require a case-sensitive comparison regardless of whether that's
standard for your operating system, use \function{fnmatchcase()}
instead.
\end{funcdesc}
\begin{funcdesc}{fnmatchcase}{filename, pattern}
Test whether \var{filename} matches \var{pattern}, returning true or
-false; the comparision is case-sensitive.
+false; the comparison is case-sensitive.
\end{funcdesc}
\begin{seealso}
- \seemodule{glob}{Shell-style path expansion}
+ \seemodule{glob}{\UNIX{} shell-style path expansion.}
\end{seealso}