]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
chore/docs: fix rst style and typo (GH-32331)
author谭九鼎 <109224573@qq.com>
Tue, 5 Apr 2022 09:08:00 +0000 (17:08 +0800)
committerGitHub <noreply@github.com>
Tue, 5 Apr 2022 09:08:00 +0000 (02:08 -0700)
Current:

![图片](https://user-images.githubusercontent.com/24759802/161704413-30fc91e8-ccd1-4617-8483-bc54ec970f30.png)

After this change:

![图片](https://user-images.githubusercontent.com/24759802/161704636-a5458192-a93a-40af-8bde-90ba80fdb53f.png)

Trivial so I don't think it needs news or issue

Automerge-Triggered-By: GH:JulienPalard
Doc/library/re.rst

index b72d72f8355f2367132bd8d938e8acc83aad7430..89de9286ace79ce00b5cc597bc70413a86344a12 100644 (file)
@@ -166,15 +166,15 @@ The special characters are:
   back-tracking when the expression following it fails to match.
   These are known as :dfn:`possessive` quantifiers.
   For example, ``a*a`` will match ``'aaaa'`` because the ``a*`` will match
-  all 4 ``'a'``s, but, when the final ``'a'`` is encountered, the
+  all 4 ``'a'``s, but, when the final ``'a'`` is encountered, the
   expression is backtracked so that in the end the ``a*`` ends up matching
-  3 ``'a'``s total, and the fourth ``'a'`` is matched by the final ``'a'``.
+  3 ``'a'``s total, and the fourth ``'a'`` is matched by the final ``'a'``.
   However, when ``a*+a`` is used to match ``'aaaa'``, the ``a*+`` will
   match all 4 ``'a'``, but when the final ``'a'`` fails to find any more
   characters to match, the expression cannot be backtracked and will thus
   fail to match.
   ``x*+``, ``x++`` and ``x?+`` are equivalent to ``(?>x*)``, ``(?>x+)``
-  and ``(?>x?)`` correspondigly.
+  and ``(?>x?)`` correspondingly.
 
    .. versionadded:: 3.11
 
@@ -208,10 +208,10 @@ The special characters are:
    *without* establishing any backtracking points.
    This is the possessive version of the quantifier above.
    For example, on the 6-character string ``'aaaaaa'``, ``a{3,5}+aa``
-   attempt to match 5 ``'a'`` characters, then, requiring 2 more ``'a'``s,
+   attempt to match 5 ``'a'`` characters, then, requiring 2 more ``'a'``s,
    will need more characters than available and thus fail, while
-   ``a{3,5}aa`` will match with ``a{3,5}`` capturing 5, then 4 ``'a'``s
-   by backtracking and then the final 2 ``'a'``s are matched by the final
+   ``a{3,5}aa`` will match with ``a{3,5}`` capturing 5, then 4 ``'a'``s
+   by backtracking and then the final 2 ``'a'``s are matched by the final
    ``aa`` in the pattern.
    ``x{m,n}+`` is equivalent to ``(?>x{m,n})``.