88# Fei Yin <[email protected] >, 201899# Junkai Shao <[email protected] >, 20181010# Danny Vi <[email protected] >, 201811- # Meng Du <[email protected] >, 20191211# Freesand Leo <[email protected] >, 201912+ # Meng Du <[email protected] >, 20191313#
1414#, fuzzy
1515msgid ""
@@ -18,7 +18,7 @@ msgstr ""
1818"Report-Msgid-Bugs-To : \n "
1919"POT-Creation-Date : 2019-02-20 10:40+0900\n "
2020"PO-Revision-Date : 2017-02-16 17:45+0000\n "
21- "Last-Translator : Freesand Leo <yuqinju@163 .com>, 2019\n "
21+ "Last-Translator : Meng Du <alphanow@gmail .com>, 2019\n "
2222"Language-Team : Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n "
2323"MIME-Version : 1.0\n "
2424"Content-Type : text/plain; charset=UTF-8\n "
@@ -286,14 +286,14 @@ msgstr "``\\W``"
286286msgid ""
287287"Matches any non-alphanumeric character; this is equivalent to the class "
288288"``[^a-zA-Z0-9_]``."
289- msgstr "匹配任何非字母与数字字符;这相当于类 ``[^a-zA-Z0-9_]``. "
289+ msgstr "匹配任何非字母与数字字符;这相当于类 ``[^a-zA-Z0-9_]``。 "
290290
291291#: ../../howto/regex.rst:152
292292msgid ""
293293"These sequences can be included inside a character class. For example, "
294294"``[\\ s,.]`` is a character class that will match any whitespace character, "
295295"or ``','`` or ``'.'``."
296- msgstr ""
296+ msgstr "这些序列可以包含在字符类中。 例如,``[ \\ s,.]`` 是一个匹配任何空格字符的字符类或者 ``','`` ,或 ``'.'``。 "
297297
298298#: ../../howto/regex.rst:156
299299msgid ""
@@ -302,10 +302,12 @@ msgid ""
302302"(:const:`re.DOTALL`) where it will match even a newline. ``.`` is often "
303303"used where you want to match \" any character\" ."
304304msgstr ""
305+ "本节的最后一个元字符是 ``.`` 。 它匹配除换行符之外的任何内容,并且有一个可选模式( :const:`re.DOTALL` )甚至可以匹配换行符。"
306+ " ``.`` 常用于你想匹配“任何字符”的地方。"
305307
306308#: ../../howto/regex.rst:163
307309msgid "Repeating Things"
308- msgstr ""
310+ msgstr "重复 "
309311
310312#: ../../howto/regex.rst:165
311313msgid ""
@@ -315,6 +317,8 @@ msgid ""
315317"they wouldn't be much of an advance. Another capability is that you can "
316318"specify that portions of the RE must be repeated a certain number of times."
317319msgstr ""
320+ "能够匹配不同的字符集合是正则表达式可以做的第一件事,这对于字符串可用方法来说是不可能的。 "
321+ "但是,如果这是正则表达式的唯一额外功能,那么它们就不会有太大的优势。 另一个功能是你可以指定正则的某些部分必须重复一定次数。"
318322
319323#: ../../howto/regex.rst:171
320324msgid ""
@@ -323,12 +327,15 @@ msgid ""
323327"that the previous character can be matched zero or more times, instead of "
324328"exactly once."
325329msgstr ""
330+ "重复中我们要了解的第一个元字符是``*``。 ``*``与字面字符``'*'``不匹配;相反,它指定前一个字符可以匹配零次或多次,而不是恰好一次。"
326331
327332#: ../../howto/regex.rst:175
328333msgid ""
329334"For example, ``ca*t`` will match ``'ct'`` (0 ``'a'`` characters), ``'cat'`` "
330335"(1 ``'a'``), ``'caaat'`` (3 ``'a'`` characters), and so forth."
331336msgstr ""
337+ "例如,``ca*t`` 将匹配``'ct'``(0个``'a'``字符),``'cat'``(1个``'a'``),` "
338+ "`'caaat'``(3个``'a'``字符),等等。"
332339
333340#: ../../howto/regex.rst:178
334341msgid ""
@@ -337,6 +344,8 @@ msgid ""
337344"portions of the pattern don't match, the matching engine will then back up "
338345"and try again with fewer repetitions."
339346msgstr ""
347+ "类似 ``*`` 这样的重复是贪婪的 :dfn:`greedy`;当重复正则时,匹配引擎将尝试尽可能多地重复它。 "
348+ "如果模式的后续部分不匹配,则匹配引擎将回退并以较少的重复次数再次尝试。"
340349
341350#: ../../howto/regex.rst:183
342351msgid ""
@@ -345,92 +354,95 @@ msgid ""
345354"letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now "
346355"imagine matching this RE against the string ``'abcbd'``."
347356msgstr ""
357+ "一个逐步的例子将使这更加明显。 让我们考虑表达式``a[bcd]*b``。 "
358+ "这个正则匹配字母``'a'``,类``[bcd]``中的零或多个字母,最后以``'b'``结尾。 "
359+ "现在想象一下这个正则与字符串``'abcbd'``匹配。"
348360
349361#: ../../howto/regex.rst:189
350362msgid "Step"
351- msgstr ""
363+ msgstr "步骤 "
352364
353365#: ../../howto/regex.rst:189
354366msgid "Matched"
355- msgstr ""
367+ msgstr "匹配 "
356368
357369#: ../../howto/regex.rst:189
358370msgid "Explanation"
359- msgstr ""
371+ msgstr "解释 "
360372
361373#: ../../howto/regex.rst:191
362374msgid "1"
363- msgstr ""
375+ msgstr "1 "
364376
365377#: ../../howto/regex.rst:191
366378msgid "``a``"
367- msgstr ""
379+ msgstr "``a`` "
368380
369381#: ../../howto/regex.rst:191
370382msgid "The ``a`` in the RE matches."
371- msgstr ""
383+ msgstr "正则中的 ``a`` 匹配。 "
372384
373385#: ../../howto/regex.rst:193
374386msgid "2"
375- msgstr ""
387+ msgstr "2 "
376388
377389#: ../../howto/regex.rst:193
378390msgid "``abcbd``"
379- msgstr ""
391+ msgstr "``abcbd`` "
380392
381393#: ../../howto/regex.rst:193
382394msgid ""
383395"The engine matches ``[bcd]*``, going as far as it can, which is to the end "
384396"of the string."
385- msgstr ""
397+ msgstr "引擎尽可能多地匹配 ``[bcd]*`` ,知道字符串结束。 "
386398
387399#: ../../howto/regex.rst:197
388400msgid "3"
389- msgstr ""
401+ msgstr "3 "
390402
391403#: ../../howto/regex.rst:197 ../../howto/regex.rst:205
392404msgid "*Failure*"
393- msgstr ""
405+ msgstr "*失败* "
394406
395407#: ../../howto/regex.rst:197
396408msgid ""
397409"The engine tries to match ``b``, but the current position is at the end of "
398410"the string, so it fails."
399- msgstr ""
411+ msgstr "引擎尝试匹配 ``b`` ,但是当前位置位于字符串结束,所以匹配失败。 "
400412
401413#: ../../howto/regex.rst:202
402414msgid "4"
403- msgstr ""
415+ msgstr "4 "
404416
405417#: ../../howto/regex.rst:202 ../../howto/regex.rst:213
406418msgid "``abcb``"
407- msgstr ""
419+ msgstr "``abcb`` "
408420
409421#: ../../howto/regex.rst:202
410422msgid "Back up, so that ``[bcd]*`` matches one less character."
411- msgstr ""
423+ msgstr "回退一次,``[bcd]*`` 少匹配一个字符。 "
412424
413425#: ../../howto/regex.rst:205
414426msgid "5"
415- msgstr ""
427+ msgstr "5 "
416428
417429#: ../../howto/regex.rst:205
418430msgid ""
419431"Try ``b`` again, but the current position is at the last character, which is"
420432" a ``'d'``."
421- msgstr ""
433+ msgstr "再次尝试匹配 ``b`` , 但是当前位置是最后一个字符 ``'d'`` 。 "
422434
423435#: ../../howto/regex.rst:209 ../../howto/regex.rst:213
424436msgid "6"
425- msgstr ""
437+ msgstr "6 "
426438
427439#: ../../howto/regex.rst:209
428440msgid "``abc``"
429- msgstr ""
441+ msgstr "``abc`` "
430442
431443#: ../../howto/regex.rst:209
432444msgid "Back up again, so that ``[bcd]*`` is only matching ``bc``."
433- msgstr ""
445+ msgstr "再次回退,所以 ``[bcd]*`` 只匹配 ``bc`` 。 "
434446
435447#: ../../howto/regex.rst:213
436448msgid ""
0 commit comments