@@ -346,8 +346,8 @@ msgid ""
346346"portions of the pattern don't match, the matching engine will then back up "
347347"and try again with fewer repetitions."
348348msgstr ""
349- "类似 ``*`` 这样的重复是 :dfn:`贪婪的` 。当重复正则时,匹配引擎将尝试重复尽可能多的次数。 "
350- "如果表达式的后续部分不匹配,则匹配引擎将回退并以较少的重复次数再次尝试 。"
349+ "像 ``*`` 这样的重复匹配是 :dfn:`贪婪的` 。当重复匹配正则时,匹配引擎会尝试重复尽可能多的次数。 如果 pattern "
350+ "的后续部分无法匹配成功,匹配引擎会回退并尝试减少重复次 。"
351351
352352#: ../../howto/regex.rst:183
353353msgid ""
@@ -356,8 +356,9 @@ msgid ""
356356"letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now "
357357"imagine matching this RE against the string ``'abcbd'``."
358358msgstr ""
359- "通过一个逐步示例更容易理解这一点。让我们分析一下表达式 ``a[bcd]*b`` 。 该表达式首先匹配一个字母 ``'a'`` ,接着匹配字符类 "
360- "``[bcd]`` 中的零个或更多个字母,最后以一个 ``'b'`` 结尾。 现在想象一下用这个正则来匹配字符串 ``'abcbd'`` 。"
359+ "我们可以通过一个逐步的例子来更好理解这一点。来看看这个正则表达式 ``a[bcd]*b`` 。 该表达式匹配的是,首先是一个字母 ``'a'`` "
360+ ",然后是零个或多个来自字符类 ``[bcd]`` 的字母,最后以一个 ``'b'`` 结尾。 现在,让我们想象一下用这个正则去匹配字符串 "
361+ "``'abcbd'`` 的过程。"
361362
362363#: ../../howto/regex.rst:189
363364msgid "Step"
@@ -409,7 +410,7 @@ msgstr "*失败*"
409410msgid ""
410411"The engine tries to match ``b``, but the current position is at the end of "
411412"the string, so it fails."
412- msgstr "引擎尝试匹配 ``b`` ,但是当前位置位于字符串末尾,所以匹配失败 。"
413+ msgstr "引擎试图匹配正则中的 ``b`` ,但是当前位置已到达字符串末尾,因此匹配失败 。"
413414
414415#: ../../howto/regex.rst:202
415416msgid "4"
@@ -431,7 +432,7 @@ msgstr "5"
431432msgid ""
432433"Try ``b`` again, but the current position is at the last character, which is"
433434" a ``'d'``."
434- msgstr "再次尝试匹配 ``b`` , 但是当前位置上的字符是最后一个字符 ``'d'`` 。"
435+ msgstr "再次尝试匹配正则中的 ``b`` , 但是当前位置上的字符是最后一个字符 ``'d'`` 。"
435436
436437#: ../../howto/regex.rst:209 ../../howto/regex.rst:213
437438msgid "6"
@@ -449,7 +450,7 @@ msgstr "再次回退,让 ``[bcd]*`` 只匹配 ``bc`` 。"
449450msgid ""
450451"Try ``b`` again. This time the character at the current position is "
451452"``'b'``, so it succeeds."
452- msgstr "再次尝试匹配 ``b`` 。 这一次当前位置的字符是 ``'b'`` ,所以它成功了 。"
453+ msgstr "再次尝试匹配正则中的 ``b`` 。 这次,当前位置的字符是 ``'b'`` ,因此匹配成功 。"
453454
454455#: ../../howto/regex.rst:219
455456msgid ""
@@ -460,9 +461,9 @@ msgid ""
460461" ``[bcd]*``, and if that subsequently fails, the engine will conclude that "
461462"the string doesn't match the RE at all."
462463msgstr ""
463- "此时正则表达式已经到达了尽头,并且匹配到了 ``'abcb'`` 。 "
464- "这个例子演示了匹配引擎一开始会尽其所能地进行匹配 ,如果没有找到匹配,它将逐步回退并重试正则的剩余部分, 如此往复,直至 ``[bcd]*`` "
465- "只匹配零次 。如果随后的匹配还是失败了,那么引擎会宣告整个正则表达式与字符串匹配失败 。"
464+ "此时,匹配引擎已经到达了正则表达式的尽头,并且成功匹配到了 ``'abcb'`` 。 "
465+ "这个例子表明了匹配引擎一开始会尽其所能地向前匹配 ,如果没有找到匹配,它会逐步回退,并重新尝试匹配正则的剩余部分, 如此往复,回退过程会一直持续到 "
466+ "``[bcd]*`` 的匹配次数为零 。如果随后的匹配还是失败了,那么引擎将得出结论:这个字符串与正则表达式不匹配 。"
466467
467468#: ../../howto/regex.rst:226
468469msgid ""
0 commit comments