mirror of
https://github.com/python/cpython
synced 2024-09-24 05:14:01 +00:00
Minor markup nits around use of \optional.
This commit is contained in:
parent
f156a44e8c
commit
77a6c9ece5
|
@ -409,7 +409,7 @@ leftmost such \character{\#} through the end of the line are ignored.
|
||||||
\var{string}, use \method{search()} instead.
|
\var{string}, use \method{search()} instead.
|
||||||
\end{funcdesc}
|
\end{funcdesc}
|
||||||
|
|
||||||
\begin{funcdesc}{split}{pattern, string, \optional{, maxsplit\code{ = 0}}}
|
\begin{funcdesc}{split}{pattern, string\optional{, maxsplit\code{ = 0}}}
|
||||||
Split \var{string} by the occurrences of \var{pattern}. If
|
Split \var{string} by the occurrences of \var{pattern}. If
|
||||||
capturing parentheses are used in \var{pattern}, then the text of all
|
capturing parentheses are used in \var{pattern}, then the text of all
|
||||||
groups in the pattern are also returned as part of the resulting list.
|
groups in the pattern are also returned as part of the resulting list.
|
||||||
|
@ -510,8 +510,8 @@ Perform the same operation as \function{sub()}, but return a tuple
|
||||||
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{,
|
\begin{methoddesc}[RegexObject]{search}{string\optional{, pos\optional{,
|
||||||
endpos}}
|
endpos}}}
|
||||||
Scan through \var{string} looking for a location where this regular
|
Scan through \var{string} looking for a location where this regular
|
||||||
expression produces a match, and return a
|
expression produces a match, and return a
|
||||||
corresponding \class{MatchObject} instance. Return \code{None} if no
|
corresponding \class{MatchObject} instance. Return \code{None} if no
|
||||||
|
@ -522,8 +522,8 @@ attributes:
|
||||||
meaning as for the \method{match()} method.
|
meaning as for the \method{match()} method.
|
||||||
\end{methoddesc}
|
\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
|
||||||
this regular expression, return a corresponding
|
this regular expression, return a corresponding
|
||||||
\class{MatchObject} instance. Return \code{None} if the string does not
|
\class{MatchObject} instance. Return \code{None} if the string does not
|
||||||
|
@ -546,7 +546,7 @@ attributes:
|
||||||
searched for a match.
|
searched for a match.
|
||||||
\end{methoddesc}
|
\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.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
@ -585,7 +585,7 @@ The pattern string from which the regex object was compiled.
|
||||||
|
|
||||||
\class{MatchObject} instances support the following methods and attributes:
|
\class{MatchObject} instances support the following methods and attributes:
|
||||||
|
|
||||||
\begin{methoddesc}[MatchObject]{group}{\optional{group1, group2, ...}}
|
\begin{methoddesc}[MatchObject]{group}{\optional{group1, \moreargs}}
|
||||||
Returns one or more subgroups of the match. If there is a single
|
Returns one or more subgroups of the match. If there is a single
|
||||||
argument, the result is a single string; if there are
|
argument, the result is a single string; if there are
|
||||||
multiple arguments, the result is a tuple with one item per argument.
|
multiple arguments, the result is a tuple with one item per argument.
|
||||||
|
@ -597,7 +597,7 @@ the string matching the the corresponding parenthesized group. If a
|
||||||
group number is negative or larger than the number of groups defined
|
group number is negative or larger than the number of groups defined
|
||||||
in the pattern, an \exception{IndexError} exception is raised.
|
in the pattern, an \exception{IndexError} exception is raised.
|
||||||
If a group is contained in a part of the pattern that did not match,
|
If a group is contained in a part of the pattern that did not match,
|
||||||
the corresponding result is \code{None}. If a group is contained in a
|
the corresponding result is \code{-1}. If a group is contained in a
|
||||||
part of the pattern that matched multiple times, the last match is
|
part of the pattern that matched multiple times, the last match is
|
||||||
returned.
|
returned.
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ used for groups that did not participate in the match; it defaults to
|
||||||
Return the indices of the start and end of the substring
|
Return the indices of the start and end of the substring
|
||||||
matched by \var{group}; \var{group} defaults to zero (meaning the whole
|
matched by \var{group}; \var{group} defaults to zero (meaning the whole
|
||||||
matched substring).
|
matched substring).
|
||||||
Return \code{None} if \var{group} exists but
|
Return \code{-1} if \var{group} exists but
|
||||||
did not contribute to the match. For a match object
|
did not contribute to the match. For a match object
|
||||||
\var{m}, and a group \var{g} that did contribute to the match, the
|
\var{m}, and a group \var{g} that did contribute to the match, the
|
||||||
substring matched by group \var{g} (equivalent to
|
substring matched by group \var{g} (equivalent to
|
||||||
|
@ -661,7 +661,7 @@ an \exception{IndexError} exception.
|
||||||
For \class{MatchObject} \var{m}, return the 2-tuple
|
For \class{MatchObject} \var{m}, return the 2-tuple
|
||||||
\code{(\var{m}.start(\var{group}), \var{m}.end(\var{group}))}.
|
\code{(\var{m}.start(\var{group}), \var{m}.end(\var{group}))}.
|
||||||
Note that if \var{group} did not contribute to the match, this is
|
Note that if \var{group} did not contribute to the match, this is
|
||||||
\code{(None, None)}. Again, \var{group} defaults to zero.
|
\code{(-1, -1)}. Again, \var{group} defaults to zero.
|
||||||
\end{methoddesc}
|
\end{methoddesc}
|
||||||
|
|
||||||
\begin{memberdesc}[MatchObject]{pos}
|
\begin{memberdesc}[MatchObject]{pos}
|
||||||
|
|
Loading…
Reference in a new issue