summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2003-05-13 14:40:24 (GMT)
committerAndrew M. Kuchling <amk@amk.ca>2003-05-13 14:40:24 (GMT)
commitc85bf582769909c421c6205e83bd0ef2cc3fa8ae (patch)
tree6f895f30916ae6ded3176a5f60d8d78b4c16bf08 /Doc
parent8d17709c5cfdaa19209a2a8154e0867b8ffe56df (diff)
downloadcpython-c85bf582769909c421c6205e83bd0ef2cc3fa8ae.zip
cpython-c85bf582769909c421c6205e83bd0ef2cc3fa8ae.tar.gz
cpython-c85bf582769909c421c6205e83bd0ef2cc3fa8ae.tar.bz2
[Bug #732124] Clarify .pos, .endpos by saying 'method' instead of 'function'
Also, put match() description before search(); search() refers to match()
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/libre.tex37
1 files changed, 19 insertions, 18 deletions
diff --git a/Doc/lib/libre.tex b/Doc/lib/libre.tex
index 0f9619f..5dbf3f0 100644
--- a/Doc/lib/libre.tex
+++ b/Doc/lib/libre.tex
@@ -638,18 +638,6 @@ ignored.
Compiled regular expression objects support the following methods and
attributes:
-\begin{methoddesc}[RegexObject]{search}{string\optional{, pos\optional{,
- endpos}}}
- Scan through \var{string} looking for a location where this regular
- expression produces a match, and return a
- corresponding \class{MatchObject} instance. Return \code{None} if no
- position in the string matches the pattern; note that this is
- different from finding a zero-length match at some point in the string.
-
- The optional \var{pos} and \var{endpos} parameters have the same
- meaning as for the \method{match()} method.
-\end{methoddesc}
-
\begin{methoddesc}[RegexObject]{match}{string\optional{, pos\optional{,
endpos}}}
If zero or more characters at the beginning of \var{string} match
@@ -679,6 +667,18 @@ attributes:
\code{\var{rx}.match(\var{string}[:50], 0)}.
\end{methoddesc}
+\begin{methoddesc}[RegexObject]{search}{string\optional{, pos\optional{,
+ endpos}}}
+ Scan through \var{string} looking for a location where this regular
+ expression produces a match, and return a
+ corresponding \class{MatchObject} instance. Return \code{None} if no
+ position in the string matches the pattern; note that this is
+ different from finding a zero-length match at some point in the string.
+
+ The optional \var{pos} and \var{endpos} parameters have the same
+ meaning as for the \method{match()} method.
+\end{methoddesc}
+
\begin{methoddesc}[RegexObject]{split}{string\optional{,
maxsplit\code{ = 0}}}
Identical to the \function{split()} function, using the compiled pattern.
@@ -812,15 +812,16 @@ Note that if \var{group} did not contribute to the match, this is
\end{methoddesc}
\begin{memberdesc}[MatchObject]{pos}
-The value of \var{pos} which was passed to the
-\function{search()} or \function{match()} function. This is the index
-into the string at which the RE engine started looking for a match.
+The value of \var{pos} which was passed to the \function{search()} or
+\function{match()} method of the \class{RegexObject}. This is the
+index into the string at which the RE engine started looking for a
+match.
\end{memberdesc}
\begin{memberdesc}[MatchObject]{endpos}
-The value of \var{endpos} which was passed to the
-\function{search()} or \function{match()} function. This is the index
-into the string beyond which the RE engine will not go.
+The value of \var{endpos} which was passed to the \function{search()}
+or \function{match()} method of the \class{RegexObject}. This is the
+index into the string beyond which the RE engine will not go.
\end{memberdesc}
\begin{memberdesc}[MatchObject]{lastindex}