mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
"Unix" --> "\UNIX{}"
Added index references to referred-to modules. Added seealso section pointing to the glob module. Removed description of translate().
This commit is contained in:
parent
eea714aed4
commit
48022db400
2 changed files with 26 additions and 34 deletions
|
|
@ -2,10 +2,10 @@
|
||||||
\label{module-fnmatch}
|
\label{module-fnmatch}
|
||||||
\stmodindex{fnmatch}
|
\stmodindex{fnmatch}
|
||||||
|
|
||||||
This module provides support for Unix shell-style wildcards, which are
|
This module provides support for \UNIX{} shell-style wildcards, which
|
||||||
\emph{not} the same as regular expressions (which are
|
are \emph{not} the same as regular expressions (which are documented
|
||||||
documented in the \code{re} module). The special characters used
|
in the \code{re}\refstmodindex{re} module). The special characters
|
||||||
in shell-style wildcards are:
|
used in shell-style wildcards are:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item[\code{*}] matches everything
|
\item[\code{*}] matches everything
|
||||||
\item[\code{?}] matches any single character
|
\item[\code{?}] matches any single character
|
||||||
|
|
@ -13,13 +13,14 @@ in shell-style wildcards are:
|
||||||
\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
|
\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Note that the filename separator (\code{'/'} on Unix) is \emph{not}
|
Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not}
|
||||||
special to this module. See module \code{glob} for pathname expansion
|
special to this module. See module \code{glob}\refstmodindex{glob}
|
||||||
(\code{glob} uses \code{fnmatch} to match filename segments).
|
for pathname expansion (\code{glob} uses \code{fnmatch()} to
|
||||||
|
match filename segments).
|
||||||
|
|
||||||
\renewcommand{\indexsubitem}{(in module fnmatch)}
|
\renewcommand{\indexsubitem}{(in module fnmatch)}
|
||||||
|
|
||||||
\begin{funcdesc}{fnmatch}{filename\, pattern}
|
\begin{funcdesc}{fnmatch}{filename, pattern}
|
||||||
Test whether the \var{filename} string matches the \var{pattern}
|
Test whether the \var{filename} string matches the \var{pattern}
|
||||||
string, returning true or false. If the operating system is
|
string, returning true or false. If the operating system is
|
||||||
case-insensitive, then both parameters will be normalized to all
|
case-insensitive, then both parameters will be normalized to all
|
||||||
|
|
@ -28,17 +29,12 @@ require a case-sensitive comparision regardless of whether that's
|
||||||
standard for your operating system, use \code{fnmatchcase()} instead.
|
standard for your operating system, use \code{fnmatchcase()} instead.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{fnmatchcase}{}
|
\begin{funcdesc}{fnmatchcase}{filename, pattern}
|
||||||
Test whether \var{filename} matches \var{pattern}, returning true or
|
Test whether \var{filename} matches \var{pattern}, returning true or
|
||||||
false; the comparision is case-sensitive.
|
false; the comparision is case-sensitive.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{translate}{pattern}
|
\begin{seealso}
|
||||||
Translate a shell pattern into a corresponding regular expression,
|
|
||||||
returning a string describing the pattern. It does not compile the
|
|
||||||
expression. \strong{Version note:} in Python 1.4 and earlier, this
|
|
||||||
function translated to \code{regex} (Emacs style) regular expressions;
|
|
||||||
in 1.5 and later, it translates to \code{re} (Perl style) regular
|
|
||||||
expressions.
|
|
||||||
\end{funcdesc}
|
|
||||||
|
|
||||||
|
\seemodule{glob}{Shell-style path expansion}
|
||||||
|
\end{seealso}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
\label{module-fnmatch}
|
\label{module-fnmatch}
|
||||||
\stmodindex{fnmatch}
|
\stmodindex{fnmatch}
|
||||||
|
|
||||||
This module provides support for Unix shell-style wildcards, which are
|
This module provides support for \UNIX{} shell-style wildcards, which
|
||||||
\emph{not} the same as regular expressions (which are
|
are \emph{not} the same as regular expressions (which are documented
|
||||||
documented in the \code{re} module). The special characters used
|
in the \code{re}\refstmodindex{re} module). The special characters
|
||||||
in shell-style wildcards are:
|
used in shell-style wildcards are:
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item[\code{*}] matches everything
|
\item[\code{*}] matches everything
|
||||||
\item[\code{?}] matches any single character
|
\item[\code{?}] matches any single character
|
||||||
|
|
@ -13,13 +13,14 @@ in shell-style wildcards are:
|
||||||
\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
|
\item[\code{[!}\var{seq}\code{]}] matches any character not in \var{seq}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Note that the filename separator (\code{'/'} on Unix) is \emph{not}
|
Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not}
|
||||||
special to this module. See module \code{glob} for pathname expansion
|
special to this module. See module \code{glob}\refstmodindex{glob}
|
||||||
(\code{glob} uses \code{fnmatch} to match filename segments).
|
for pathname expansion (\code{glob} uses \code{fnmatch()} to
|
||||||
|
match filename segments).
|
||||||
|
|
||||||
\renewcommand{\indexsubitem}{(in module fnmatch)}
|
\renewcommand{\indexsubitem}{(in module fnmatch)}
|
||||||
|
|
||||||
\begin{funcdesc}{fnmatch}{filename\, pattern}
|
\begin{funcdesc}{fnmatch}{filename, pattern}
|
||||||
Test whether the \var{filename} string matches the \var{pattern}
|
Test whether the \var{filename} string matches the \var{pattern}
|
||||||
string, returning true or false. If the operating system is
|
string, returning true or false. If the operating system is
|
||||||
case-insensitive, then both parameters will be normalized to all
|
case-insensitive, then both parameters will be normalized to all
|
||||||
|
|
@ -28,17 +29,12 @@ require a case-sensitive comparision regardless of whether that's
|
||||||
standard for your operating system, use \code{fnmatchcase()} instead.
|
standard for your operating system, use \code{fnmatchcase()} instead.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{fnmatchcase}{}
|
\begin{funcdesc}{fnmatchcase}{filename, pattern}
|
||||||
Test whether \var{filename} matches \var{pattern}, returning true or
|
Test whether \var{filename} matches \var{pattern}, returning true or
|
||||||
false; the comparision is case-sensitive.
|
false; the comparision is case-sensitive.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{translate}{pattern}
|
\begin{seealso}
|
||||||
Translate a shell pattern into a corresponding regular expression,
|
|
||||||
returning a string describing the pattern. It does not compile the
|
|
||||||
expression. \strong{Version note:} in Python 1.4 and earlier, this
|
|
||||||
function translated to \code{regex} (Emacs style) regular expressions;
|
|
||||||
in 1.5 and later, it translates to \code{re} (Perl style) regular
|
|
||||||
expressions.
|
|
||||||
\end{funcdesc}
|
|
||||||
|
|
||||||
|
\seemodule{glob}{Shell-style path expansion}
|
||||||
|
\end{seealso}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue