Commit c85bf582 authored by Andrew M. Kuchling's avatar Andrew M. Kuchling

[Bug #732124] Clarify .pos, .endpos by saying 'method' instead of 'function'

Also, put match() description before search(); search() refers to match()
parent 8d17709c
...@@ -638,18 +638,6 @@ ignored. ...@@ -638,18 +638,6 @@ ignored.
Compiled regular expression objects support the following methods and Compiled regular expression objects support the following methods and
attributes: 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{, \begin{methoddesc}[RegexObject]{match}{string\optional{, pos\optional{,
endpos}}} endpos}}}
If zero or more characters at the beginning of \var{string} match If zero or more characters at the beginning of \var{string} match
...@@ -679,6 +667,18 @@ attributes: ...@@ -679,6 +667,18 @@ attributes:
\code{\var{rx}.match(\var{string}[:50], 0)}. \code{\var{rx}.match(\var{string}[:50], 0)}.
\end{methoddesc} \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{, \begin{methoddesc}[RegexObject]{split}{string\optional{,
maxsplit\code{ = 0}}} maxsplit\code{ = 0}}}
Identical to the \function{split()} function, using the compiled pattern. 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 ...@@ -812,15 +812,16 @@ Note that if \var{group} did not contribute to the match, this is
\end{methoddesc} \end{methoddesc}
\begin{memberdesc}[MatchObject]{pos} \begin{memberdesc}[MatchObject]{pos}
The value of \var{pos} which was passed to the The value of \var{pos} which was passed to the \function{search()} or
\function{search()} or \function{match()} function. This is the index \function{match()} method of the \class{RegexObject}. This is the
into the string at which the RE engine started looking for a match. index into the string at which the RE engine started looking for a
match.
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}[MatchObject]{endpos} \begin{memberdesc}[MatchObject]{endpos}
The value of \var{endpos} which was passed to the The value of \var{endpos} which was passed to the \function{search()}
\function{search()} or \function{match()} function. This is the index or \function{match()} method of the \class{RegexObject}. This is the
into the string beyond which the RE engine will not go. index into the string beyond which the RE engine will not go.
\end{memberdesc} \end{memberdesc}
\begin{memberdesc}[MatchObject]{lastindex} \begin{memberdesc}[MatchObject]{lastindex}
......
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