Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c38839e

Browse files
andyjjrtweblate
authored andcommitted
Translated using Weblate (regex (generated) (regex))
Currently translated at 61.5% (176 of 286 strings) Translation: python-doc-zhtw/howto Translate-URL: http://weblate.andyjjrt.cc/projects/python-doc-zhtw/howto/regex/
1 parent 00edd83 commit c38839e

File tree

1 file changed

+40
-41
lines changed

1 file changed

+40
-41
lines changed

howto/regex.po

Lines changed: 40 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgstr ""
1111
"Report-Msgid-Bugs-To: \n"
1212
"POT-Creation-Date: 2022-10-15 20:43+0000\n"
1313
"PO-Revision-Date: 2023-04-29 13:31+0000\n"
14-
"Last-Translator: 鍾禕宸 <eason.chung9@gmail.com>\n"
14+
"Last-Translator: andyjjrt <andyjjrt@gmail.com>\n"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-tw)"
1616
"\n"
1717
"Language: regex\n"
@@ -784,9 +784,8 @@ msgid "``findall()``"
784784
msgstr "``findall()``"
785785

786786
#: ../../howto/regex.rst:368
787-
#, fuzzy
788787
msgid "Find all substrings where the RE matches, and returns them as a list."
789-
msgstr "尋找所有符合正規表示式的子字串,並將其以清單形式返回。"
788+
msgstr "尋找所有符合正規表示式的子字串,並將其以list(串列)形式返回。"
790789

791790
#: ../../howto/regex.rst:371
792791
msgid "``finditer()``"
@@ -1404,15 +1403,15 @@ msgid "``\\b``"
14041403
msgstr "``\\b``"
14051404

14061405
#: ../../howto/regex.rst:744
1407-
#, fuzzy
14081406
msgid ""
14091407
"Word boundary. This is a zero-width assertion that matches only at the "
14101408
"beginning or end of a word. A word is defined as a sequence of alphanumeric "
14111409
"characters, so the end of a word is indicated by whitespace or a non-"
14121410
"alphanumeric character."
14131411
msgstr ""
1414-
"單字邊界,是一個零寬度的斷言,只會在單詞的開頭或結尾符合。 單字指由英文字母和"
1415-
"阿拉伯數字所構成的序列,因此單詞的結尾必定以空格或非英數字符號來表示。"
1412+
"單字邊界,是一個零寬度斷言(zero-width "
1413+
"assertion),只會在單詞的開頭或結尾符合。 單字指的是由英文字母和阿拉伯數字所"
1414+
"構成的序列,因此單字的結尾必須以空格或非英數字符號來表示。"
14161415

14171416
#: ../../howto/regex.rst:749
14181417
#, fuzzy
@@ -1423,7 +1422,6 @@ msgstr "以下範例只會比對「``class``」是否為一個完整的單字,
14231422
"會比對到。 ::"
14241423

14251424
#: ../../howto/regex.rst:760
1426-
#, fuzzy
14271425
msgid ""
14281426
"There are two subtleties you should remember when using this special "
14291427
"sequence. First, this is the worst collision between Python's string "
@@ -1433,39 +1431,39 @@ msgid ""
14331431
"won't match as you expect it to. The following example looks the same as our "
14341432
"previous RE, but omits the ``'r'`` in front of the RE string. ::"
14351433
msgstr ""
1436-
"當您使用這個特殊序列時,請注意兩點細節。首先,這是 Python "
1437-
"字符串字面值和正則表達式序列之間最嚴重的衝突。在 Python 字符串字面值中,“\\b”"
1438-
" 是回退字符(ASCII 值為 8)。如果您沒有使用原始字符串,那麼 Python 會將“\\b"
1439-
"”轉換為回退鍵,而您的正則表達式不會按預期匹配。以下實例看起來與我們之前的 RE "
1440-
"相同,但省略了 RE 字符串前面的“r”。::"
1434+
"使用這個特殊序列時,請注意兩點細節。首先,這是 Python "
1435+
"字串文字和正則表達式序列之間最嚴重的衝突。在 Python 字串文字中, ``\\b`` "
1436+
"是回退字符(ASCII 值為 8)。如果沒有使用原始字串,那麼 Python 會將 ``\\b`` "
1437+
"轉換為回退鍵,而正則表達式不會按預期匹配。以下實例看起來與我們之前的 RE "
1438+
"相同,但省略了 RE 字符串前面的 ``'r'`` 。\n"
1439+
"\n"
1440+
"::"
14411441

14421442
#: ../../howto/regex.rst:774
1443-
#, fuzzy
14441443
msgid ""
14451444
"Second, inside a character class, where there's no use for this assertion, ``"
14461445
"\\b`` represents the backspace character, for compatibility with Python's "
14471446
"string literals."
14481447
msgstr "第二點,在字元類別中,如果不需要這個斷言,``\\b`` "
1449-
"代表的是消除符號(backspace),為了與 Python 的字串表示法相容。"
1448+
"代表的是回退符號(backspace),為了與 Python 的字串表示法相容。"
14501449

14511450
#: ../../howto/regex.rst:781
14521451
msgid "``\\B``"
14531452
msgstr "``\\B``"
14541453

14551454
#: ../../howto/regex.rst:779
1456-
#, fuzzy
14571455
msgid ""
14581456
"Another zero-width assertion, this is the opposite of ``\\b``, only matching "
14591457
"when the current position is not at a word boundary."
1460-
msgstr "另一個零寬斷言,這是 ``\\b`` 的相反,僅在當前位置不位於單字邊界時匹配。"
1458+
msgstr "另一個零寬度斷言(zero-width assertion),這是 ``\\b`` "
1459+
"的相反,僅在當前位置不位於單字邊界時匹配。"
14611460

14621461
#: ../../howto/regex.rst:784
14631462
#, fuzzy
14641463
msgid "Grouping"
14651464
msgstr "群組化"
14661465

14671466
#: ../../howto/regex.rst:786
1468-
#, fuzzy
14691467
msgid ""
14701468
"Frequently you need to obtain more information than just whether the RE "
14711469
"matched or not. Regular expressions are often used to dissect strings by "
@@ -1475,7 +1473,9 @@ msgid ""
14751473
msgstr ""
14761474
"常常需要取得比僅僅判斷正規表達式是否符合的更多資訊。經常用來剖析字串的方式是"
14771475
"撰寫一個正規表示式,其中包含許多子組,可以匹配各種不同的所需元素。例如,RFC-8"
1478-
"22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰"
1476+
"22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰\n"
1477+
"\n"
1478+
"::"
14791479

14801480
#: ../../howto/regex.rst:799
14811481
#, fuzzy
@@ -1487,7 +1487,6 @@ msgstr "這可以透過匹配整個標頭行的正規表示式來處理,其中
14871487
"個群組匹配標頭值。"
14881488

14891489
#: ../../howto/regex.rst:803
1490-
#, fuzzy
14911490
msgid ""
14921491
"Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and "
14931492
"``')'`` have much the same meaning as they do in mathematical expressions; "
@@ -1496,12 +1495,14 @@ msgid ""
14961495
"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more "
14971496
"repetitions of ``ab``. ::"
14981497
msgstr ""
1499-
"群組由「(」和「)」 元字符標記。 在數學表達式中,「(」和 "
1500-
"「)」具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如*"
1501-
"、+、?或{m,n})重複群組內容。 例如,“(ab)*”可以匹配零個或多個“ ab”。::"
1498+
"群組由 ``'('`` 和 ``')'`` 元字符標記。 在數學表達式中,``'('``和 ``')'`` "
1499+
"具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如 ``*``"
1500+
" 、 ``+`` 、 ``?``或 `{m,n}`)重複群組內容。 例如, ``(ab}*`` "
1501+
"可以匹配零個或多個 ``ab`` 。\n"
1502+
"\n"
1503+
"::"
15021504

15031505
#: ../../howto/regex.rst:814
1504-
#, fuzzy
15051506
msgid ""
15061507
"Groups indicated with ``'('``, ``')'`` also capture the starting and ending "
15071508
"index of the text that they match; this can be retrieved by passing an "
@@ -1512,24 +1513,26 @@ msgid ""
15121513
"we'll see how to express groups that don't capture the span of text that "
15131514
"they match. ::"
15141515
msgstr ""
1515-
"以符合守則的方式翻譯如下:有括弧主分組 ``'('``, ``')'`` "
1516+
"以符合守則的方式翻譯如下:有括弧主分組 ``'('`` , ``')'`` "
15161517
"捕捉了匹配文本的開始與結束索引,可透過向 :meth:`~re.Match.group`、:meth:`~re."
15171518
"Match.start`、:meth:`~re.Match.end` 和:meth:`~re.Match.span` "
15181519
"中傳入參數獲取此訊息。 主分組以 0 開始編號,因此第一個是 "
15191520
"0,代表整個正規表示式(RE),所以當透過 :ref:`match object <match-objects>` "
15201521
"方法時預設值皆會回傳主分組 0。 "
1521-
"後續我們也會看到如何表示不包含其匹配範圍但需要群聚化的案例. ::"
1522+
"後續我們也會看到如何表示不包含其匹配範圍但需要群聚化的案例。\n"
1523+
"\n"
1524+
"::"
15221525

15231526
#: ../../howto/regex.rst:830
1524-
#, fuzzy
15251527
msgid ""
15261528
"Subgroups are numbered from left to right, from 1 upward. Groups can be "
15271529
"nested; to determine the number, just count the opening parenthesis "
15281530
"characters, going from left to right. ::"
15291531
msgstr ""
15301532
"子群組自左而右,由1開始進行編號。此外,群組還可以嵌套;想要確定嵌套數量時,只"
1531-
"需要從左至右計算開啟括號的個數即可。::(註:原文中的冒號符號是保留rst格式用法"
1532-
",在之前加上了反斜槓表示轉譯)"
1533+
"需要從左至右計算開啟括號的個數即可。\n"
1534+
"\n"
1535+
"::"
15331536

15341537
#: ../../howto/regex.rst:843
15351538
#, fuzzy
@@ -1541,17 +1544,15 @@ msgstr ":meth:`~re.Match.group` "
15411544
"可以同時傳入多個群組編號,這樣它會回傳包含這些群組對應數值的元组。"
15421545

15431546
#: ../../howto/regex.rst:849
1544-
#, fuzzy
15451547
msgid ""
15461548
"The :meth:`~re.Match.groups` method returns a tuple containing the strings "
15471549
"for all the subgroups, from 1 up to however many there are. ::"
15481550
msgstr ""
15491551
":meth:`~re.Match.groups` "
1550-
"方法會傳回一個元組(tuple),裡面包含所有子群組(subgroups)所對應的字串,從 "
1551-
"1 到數量上限不等。"
1552+
"會傳回一個元組(tuple),裡面包含所有子群組(subgroups)所對應的字串,從 1 "
1553+
"到數量上限不等。"
15521554

15531555
#: ../../howto/regex.rst:855
1554-
#, fuzzy
15551556
msgid ""
15561557
"Backreferences in a pattern allow you to specify that the contents of an "
15571558
"earlier capturing group must also be found at the current location in the "
@@ -1562,29 +1563,27 @@ msgid ""
15621563
"when incorporating backreferences in a RE."
15631564
msgstr ""
15641565
"在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字串的當前位置也存在。例"
1565-
"如,若精確內容與第一個群組相符合,則\\1將會成功;反之失敗。請記得 Python "
1566-
"字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
1566+
"如,若精確內容與第一個群組相符合,則 ``\\1`` 將會成功;反之失敗。請記得 "
1567+
"Python 字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
15671568
"中嵌入回溯參照時要用原始字串表達法(raw string)。"
15681569

15691570
#: ../../howto/regex.rst:863
1570-
#, fuzzy
15711571
msgid "For example, the following RE detects doubled words in a string. ::"
15721572
msgstr ""
1573-
"例如,以下的正規表示式可以在一個字串中偵測出重複的單詞。:: import re text "
1574-
"= 'Hello world world' pattern = r'\\b(\\w+)\\s+\\1\\b' match = re.search("
1575-
"pattern, text) if match: print('Found duplicated word:', match.group(1))"
1573+
"例如,以下的正規表示式可以在一個字串中偵測出重複的單詞。\n"
1574+
"\n"
1575+
"::"
15761576

15771577
#: ../../howto/regex.rst:869
1578-
#, fuzzy
15791578
msgid ""
15801579
"Backreferences like this aren't often useful for just searching through a "
15811580
"string --- there are few text formats which repeat data in this way --- but "
15821581
"you'll soon find out that they're *very* useful when performing string "
15831582
"substitutions."
15841583
msgstr ""
15851584
"像這樣的反向參照通常對於只是搜尋字串來說並不常用 --- "
1586-
"很少有文字格式會以此方式重複數據 --- "
1587-
"但當你執行字串取代時,就很快發現它們*非常*有用。"
1585+
"很少有文字格式會以此方式重複數據 --- 但當你執行字串取代時,就很快發現它們 "
1586+
"*非常* 有用。"
15881587

15891588
#: ../../howto/regex.rst:875
15901589
#, fuzzy

0 commit comments

Comments
 (0)