summaryrefslogtreecommitdiffstats
path: root/Doc/libre.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1998-02-13 06:58:54 (GMT)
committerFred Drake <fdrake@acm.org>1998-02-13 06:58:54 (GMT)
commit1947991c2f85db781fb3fcdc9e3bcfe2905e58e2 (patch)
tree260789493c7151408f009eaa84a7815ce4d28246 /Doc/libre.tex
parentdc8af0acc1fbeec89e43f1ea43bf1a4d016f4fc6 (diff)
downloadcpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.zip
cpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.tar.gz
cpython-1947991c2f85db781fb3fcdc9e3bcfe2905e58e2.tar.bz2
Remove all \bcode / \ecode cruft; this is no longer needed. See previous
checkin of myformat.sty. Change "\renewcommand{\indexsubitem}{(...)}" to "\setindexsubitem{(...)}" everywhere. Some other minor nits that I happened to come across.
Diffstat (limited to 'Doc/libre.tex')
-rw-r--r--Doc/libre.tex18
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/libre.tex b/Doc/libre.tex
index 3c288d1..55125ec 100644
--- a/Doc/libre.tex
+++ b/Doc/libre.tex
@@ -258,7 +258,7 @@ for the current locale.
The module defines the following functions and constants, and an exception:
-\renewcommand{\indexsubitem}{(in module re)}
+\setindexsubitem{(in module re)}
\begin{funcdesc}{compile}{pattern\optional{\, flags}}
Compile a regular expression pattern into a regular expression
@@ -313,10 +313,10 @@ leftmost such \code{\#} through the end of the line are ignored.
The sequence
%
-\bcode\begin{verbatim}
+\begin{verbatim}
prog = re.compile(pat)
result = prog.match(str)
-\end{verbatim}\ecode
+\end{verbatim}
%
is equivalent to
@@ -365,14 +365,14 @@ expression will be used several times in a single program.
1.5 release, \var{maxsplit} was ignored. This has been fixed in
later releases.)
%
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> re.split('[\W]+', 'Words, words, words.')
['Words', 'words', 'words', '']
>>> re.split('([\W]+)', 'Words, words, words.')
['Words', ', ', 'words', ', ', 'words', '.', '']
>>> re.split('[\W]+', 'Words, words, words.', 1)
['Words', 'words, words.']
-\end{verbatim}\ecode
+\end{verbatim}
%
This function combines and extends the functionality of
the old \code{regsub.split()} and \code{regsub.splitx()}.
@@ -387,13 +387,13 @@ it is called for every non-overlapping occurance of \var{pattern}.
The function takes a single match object argument, and returns the
replacement string. For example:
%
-\bcode\begin{verbatim}
+\begin{verbatim}
>>> def dashrepl(matchobj):
... if matchobj.group(0) == '-': return ' '
... else: return '-'
>>> re.sub('-{1,2}', dashrepl, 'pro----gram-files')
'pro--gram files'
-\end{verbatim}\ecode
+\end{verbatim}
%
The pattern may be a string or a
regex object; if you need to specify
@@ -428,7 +428,7 @@ Perform the same operation as \code{sub()}, but return a tuple
Compiled regular expression objects support the following methods and
attributes:
-\renewcommand{\indexsubitem}{(re method)}
+\setindexsubitem{(re method)}
\begin{funcdesc}{match}{string\optional{\, pos}\optional{\, endpos}}
If zero or more characters at the beginning of \var{string} match
this regular expression, return a corresponding
@@ -469,7 +469,7 @@ Identical to the \code{sub()} function, using the compiled pattern.
Identical to the \code{subn()} function, using the compiled pattern.
\end{funcdesc}
-\renewcommand{\indexsubitem}{(regex attribute)}
+\setindexsubitem{(regex attribute)}
\begin{datadesc}{flags}
The flags argument used when the regex object was compiled, or 0 if no