Index: Doc/library/re.rst =================================================================== --- Doc/library/re.rst (revision 78277) +++ Doc/library/re.rst (working copy) @@ -518,7 +518,7 @@ .. function:: search(pattern, string[, flags]) Scan through *string* looking for a location where the regular expression - *pattern* produces a match, and return a corresponding :class:`MatchObject` + *pattern* produces a match, and return a corresponding :ref:`match-objects` instance. Return ``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. @@ -527,7 +527,7 @@ .. function:: match(pattern, string[, flags]) If zero or more characters at the beginning of *string* match the regular - expression *pattern*, return a corresponding :class:`MatchObject` instance. + expression *pattern*, return a corresponding :ref:`match-objects` instance. Return ``None`` if the string does not match the pattern; note that this is different from a zero-length match. @@ -595,7 +595,7 @@ .. function:: finditer(pattern, string[, flags]) - Return an :term:`iterator` yielding :class:`MatchObject` instances over all + Return an :term:`iterator` yielding :ref:`match-objects` instances over all non-overlapping matches for the RE *pattern* in *string*. The *string* is scanned left-to-right, and matches are returned in the order found. Empty matches are included in the result unless they touch the beginning of another @@ -692,7 +692,7 @@ .. method:: RegexObject.match(string[, pos[, endpos]]) If zero or more characters at the beginning of *string* match this regular - expression, return a corresponding :class:`MatchObject` instance. Return + expression, return a corresponding :ref:`match-objects` instance. Return ``None`` if the string does not match the pattern; note that this is different from a zero-length match. @@ -723,7 +723,7 @@ .. method:: RegexObject.search(string[, pos[, endpos]]) Scan through *string* looking for a location where this regular expression - produces a match, and return a corresponding :class:`MatchObject` instance. + produces a match, and return a corresponding :ref:`match-objects` instance. Return ``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. @@ -912,7 +912,7 @@ .. method:: MatchObject.span([group]) - For :class:`MatchObject` *m*, return the 2-tuple ``(m.start(group), + For :ref:`match-objects` *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note that if *group* did not contribute to the match, this is ``(-1, -1)``. *group* defaults to zero, the entire match. @@ -949,7 +949,7 @@ .. attribute:: MatchObject.re The regular expression object whose :meth:`~RegexObject.match` or - :meth:`~RegexObject.search` method produced this :class:`MatchObject` + :meth:`~RegexObject.search` method produced this :ref:`match-objects` instance. @@ -1002,7 +1002,7 @@ "" To find out what card the pair consists of, one could use the -:meth:`~MatchObject.group` method of :class:`MatchObject` in the following +:meth:`~MatchObject.group` method of :ref:`match-objects` in the following manner: .. doctest:: @@ -1218,7 +1218,7 @@ If one wants more information about all matches of a pattern than the matched text, :func:`finditer` is useful as it provides instances of -:class:`MatchObject` instead of strings. Continuing with the previous example, +:ref:`match-objects` instead of strings. Continuing with the previous example, if one was a writer who wanted to find all of the adverbs *and their positions* in some text, he or she would use :func:`finditer` in the following manner: