@@ -538,8 +538,8 @@ msgid ""
538538"regular expression engine, allowing you to compile REs into objects and then"
539539" perform matches with them."
540540msgstr ""
541- "现在我们已经了解了一些简单的正则表达式,那么我们如何在 Python 中实际使用它们呢? :mod:`re` "
542- "模块提供了正则表达式引擎的接口,可以让你将正则编译为对象,然后用它们来进行匹配 。"
541+ "现在我们已经了解了一些简单的正则表达式,那么如何在 Python 中实际使用它们呢? :mod:`re` "
542+ "模块提供了正则表达式引擎的接口,使你能够将正则表达式编译为对象,然后用使用这些对象进行匹配操作 。"
543543
544544#: ../../howto/regex.rst:268
545545msgid "Compiling Regular Expressions"
@@ -550,7 +550,7 @@ msgid ""
550550"Regular expressions are compiled into pattern objects, which have methods "
551551"for various operations such as searching for pattern matches or performing "
552552"string substitutions. ::"
553- msgstr "正则表达式被编译成模式对象,模式对象具有各种操作的方法 ,例如搜索模式匹配或执行字符串替换。::"
553+ msgstr "正则表达式会被编译成 pattern 对象,这些 pattern 对象具有各种操作方法 ,例如搜索模式匹配或执行字符串替换。::"
554554
555555#: ../../howto/regex.rst:279
556556msgid ""
@@ -559,7 +559,7 @@ msgid ""
559559"available settings later, but for now a single example will do::"
560560msgstr ""
561561":func:`re.compile` 也接受一个可选的 *flags* 参数,用于启用各种特殊功能和语法变体。 "
562- "我们稍后将介绍可用的设置,但现在只需一个例子 ::"
562+ "我们稍后将介绍可用的设置,但现在先举一个简单的例子 ::"
563563
564564#: ../../howto/regex.rst:285
565565msgid ""
@@ -571,16 +571,16 @@ msgid ""
571571"simply a C extension module included with Python, just like the "
572572":mod:`socket` or :mod:`zlib` modules."
573573msgstr ""
574- "正则作为字符串传递给 :func:`re.compile` 。 "
575- "正则被处理为字符串,因为正则表达式不是核心Python语言的一部分,并且没有创建用于表达它们的特殊语法 。 "
576- "(有些应用程序根本不需要正则,因此不需要通过包含它们来扩展语言规范。)相反 ,:mod:`re` 模块只是Python附带的C扩展模块,就类似于 "
577- ":mod:`socket` 或 :mod:`zlib` 模块 。"
574+ "在这个例子中,正则以字符串形式传递给了 :func:`re.compile` 函数。之所将正则作为字符串处理,是因为正则表达式并非 Python "
575+ "语言的核心组成部分,也没有为其创建专门的语法 。 "
576+ "(有些应用程序根本不需要正则,因此也就没必要将它纳入语言核心而使语言规范变得臃肿。)实际上 ,:mod:`re` 模块只是一个 Python 附带的 C "
577+ "扩展模块,就像 :mod:`socket` 或 :mod:`zlib` 模块一样 。"
578578
579579#: ../../howto/regex.rst:292
580580msgid ""
581581"Putting REs in strings keeps the Python language simpler, but has one "
582582"disadvantage which is the topic of the next section."
583- msgstr "将正则放在字符串中可以使 Python 语言更简单,但有一个缺点是下一节的主题 。"
583+ msgstr "使用字符串存放正则表达式,的确可以让 Python 语言保持简洁,但也带来了一个缺点,这将是下一节讨论的主题 。"
584584
585585#: ../../howto/regex.rst:299
586586msgid "The Backslash Plague"
0 commit comments