Kaydet (Commit) 8e944898 authored tarafından Guido van Rossum's avatar Guido van Rossum

Add a note that up to 1.4, translate() produced Emacs style syntax; in

1.5, it produces Perl style syntax.  Also change "Python's regular
expressions" into plain "regular expression" in the intro.
üst e33e9034
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\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 are
\emph{not} the same as Python's regular expressions (which are \emph{not} the same as regular expressions (which are
documented in the \code{re} module). The special characters used documented in the \code{re} module). The special characters used
in shell-style wildcards are: in shell-style wildcards are:
\begin{itemize} \begin{itemize}
...@@ -36,6 +36,9 @@ false; the comparision is case-sensitive. ...@@ -36,6 +36,9 @@ false; the comparision is case-sensitive.
\begin{funcdesc}{translate}{pattern} \begin{funcdesc}{translate}{pattern}
Translate a shell pattern into a corresponding regular expression, Translate a shell pattern into a corresponding regular expression,
returning a string describing the pattern. It does not compile the returning a string describing the pattern. It does not compile the
expression. 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} \end{funcdesc}
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
\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 are
\emph{not} the same as Python's regular expressions (which are \emph{not} the same as regular expressions (which are
documented in the \code{re} module). The special characters used documented in the \code{re} module). The special characters used
in shell-style wildcards are: in shell-style wildcards are:
\begin{itemize} \begin{itemize}
...@@ -36,6 +36,9 @@ false; the comparision is case-sensitive. ...@@ -36,6 +36,9 @@ false; the comparision is case-sensitive.
\begin{funcdesc}{translate}{pattern} \begin{funcdesc}{translate}{pattern}
Translate a shell pattern into a corresponding regular expression, Translate a shell pattern into a corresponding regular expression,
returning a string describing the pattern. It does not compile the returning a string describing the pattern. It does not compile the
expression. 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} \end{funcdesc}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment