@@ -11,7 +11,7 @@ msgstr ""
11
11
"Report-Msgid-Bugs-To : \n "
12
12
"POT-Creation-Date : 2022-10-15 20:43+0000\n "
13
13
"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 "
15
15
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh-tw) "
16
16
"\n "
17
17
"Language : regex\n "
@@ -784,9 +784,8 @@ msgid "``findall()``"
784
784
msgstr "``findall()``"
785
785
786
786
#: ../../howto/regex.rst:368
787
- #, fuzzy
788
787
msgid "Find all substrings where the RE matches, and returns them as a list."
789
- msgstr "尋找所有符合正規表示式的子字串,並將其以清單形式返回 。"
788
+ msgstr "尋找所有符合正規表示式的子字串,並將其以list(串列)形式返回 。"
790
789
791
790
#: ../../howto/regex.rst:371
792
791
msgid "``finditer()``"
@@ -1404,15 +1403,15 @@ msgid "``\\b``"
1404
1403
msgstr "``\\ b``"
1405
1404
1406
1405
#: ../../howto/regex.rst:744
1407
- #, fuzzy
1408
1406
msgid ""
1409
1407
"Word boundary. This is a zero-width assertion that matches only at the "
1410
1408
"beginning or end of a word. A word is defined as a sequence of alphanumeric "
1411
1409
"characters, so the end of a word is indicated by whitespace or a non-"
1412
1410
"alphanumeric character."
1413
1411
msgstr ""
1414
- "單字邊界,是一個零寬度的斷言,只會在單詞的開頭或結尾符合。 單字指由英文字母和"
1415
- "阿拉伯數字所構成的序列,因此單詞的結尾必定以空格或非英數字符號來表示。"
1412
+ "單字邊界,是一個零寬度斷言(zero-width "
1413
+ "assertion),只會在單詞的開頭或結尾符合。 單字指的是由英文字母和阿拉伯數字所"
1414
+ "構成的序列,因此單字的結尾必須以空格或非英數字符號來表示。"
1416
1415
1417
1416
#: ../../howto/regex.rst:749
1418
1417
#, fuzzy
@@ -1423,7 +1422,6 @@ msgstr "以下範例只會比對「``class``」是否為一個完整的單字,
1423
1422
"會比對到。 ::"
1424
1423
1425
1424
#: ../../howto/regex.rst:760
1426
- #, fuzzy
1427
1425
msgid ""
1428
1426
"There are two subtleties you should remember when using this special "
1429
1427
"sequence. First, this is the worst collision between Python's string "
@@ -1433,39 +1431,39 @@ msgid ""
1433
1431
"won't match as you expect it to. The following example looks the same as our "
1434
1432
"previous RE, but omits the ``'r'`` in front of the RE string. ::"
1435
1433
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
+ "::"
1441
1441
1442
1442
#: ../../howto/regex.rst:774
1443
- #, fuzzy
1444
1443
msgid ""
1445
1444
"Second, inside a character class, where there's no use for this assertion, ``"
1446
1445
"\\ b`` represents the backspace character, for compatibility with Python's "
1447
1446
"string literals."
1448
1447
msgstr "第二點,在字元類別中,如果不需要這個斷言,``\\ b`` "
1449
- "代表的是消除符號 (backspace),為了與 Python 的字串表示法相容。"
1448
+ "代表的是回退符號 (backspace),為了與 Python 的字串表示法相容。"
1450
1449
1451
1450
#: ../../howto/regex.rst:781
1452
1451
msgid "``\\ B``"
1453
1452
msgstr "``\\ B``"
1454
1453
1455
1454
#: ../../howto/regex.rst:779
1456
- #, fuzzy
1457
1455
msgid ""
1458
1456
"Another zero-width assertion, this is the opposite of ``\\ b``, only matching "
1459
1457
"when the current position is not at a word boundary."
1460
- msgstr "另一個零寬斷言,這是 ``\\ b`` 的相反,僅在當前位置不位於單字邊界時匹配。"
1458
+ msgstr "另一個零寬度斷言(zero-width assertion),這是 ``\\ b`` "
1459
+ "的相反,僅在當前位置不位於單字邊界時匹配。"
1461
1460
1462
1461
#: ../../howto/regex.rst:784
1463
1462
#, fuzzy
1464
1463
msgid "Grouping"
1465
1464
msgstr "群組化"
1466
1465
1467
1466
#: ../../howto/regex.rst:786
1468
- #, fuzzy
1469
1467
msgid ""
1470
1468
"Frequently you need to obtain more information than just whether the RE "
1471
1469
"matched or not. Regular expressions are often used to dissect strings by "
@@ -1475,7 +1473,9 @@ msgid ""
1475
1473
msgstr ""
1476
1474
"常常需要取得比僅僅判斷正規表達式是否符合的更多資訊。經常用來剖析字串的方式是"
1477
1475
"撰寫一個正規表示式,其中包含許多子組,可以匹配各種不同的所需元素。例如,RFC-8"
1478
- "22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰"
1476
+ "22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰\n"
1477
+ "\n"
1478
+ "::"
1479
1479
1480
1480
#: ../../howto/regex.rst:799
1481
1481
#, fuzzy
@@ -1487,7 +1487,6 @@ msgstr "這可以透過匹配整個標頭行的正規表示式來處理,其中
1487
1487
"個群組匹配標頭值。"
1488
1488
1489
1489
#: ../../howto/regex.rst:803
1490
- #, fuzzy
1491
1490
msgid ""
1492
1491
"Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and "
1493
1492
"``')'`` have much the same meaning as they do in mathematical expressions; "
@@ -1496,12 +1495,14 @@ msgid ""
1496
1495
"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more "
1497
1496
"repetitions of ``ab``. ::"
1498
1497
msgstr ""
1499
- "群組由「(」和「)」 元字符標記。 在數學表達式中,「(」和 "
1500
- "「)」具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如*"
1501
- "、+、?或{m,n})重複群組內容。 例如,“(ab)*”可以匹配零個或多個“ ab”。::"
1498
+ "群組由 ``'('`` 和 ``')'`` 元字符標記。 在數學表達式中,``'('``和 ``')'`` "
1499
+ "具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如 ``*``"
1500
+ " 、 ``+`` 、 ``?``或 `{m,n}`)重複群組內容。 例如, ``(ab}*`` "
1501
+ "可以匹配零個或多個 ``ab`` 。\n"
1502
+ "\n"
1503
+ "::"
1502
1504
1503
1505
#: ../../howto/regex.rst:814
1504
- #, fuzzy
1505
1506
msgid ""
1506
1507
"Groups indicated with ``'('``, ``')'`` also capture the starting and ending "
1507
1508
"index of the text that they match; this can be retrieved by passing an "
@@ -1512,24 +1513,26 @@ msgid ""
1512
1513
"we'll see how to express groups that don't capture the span of text that "
1513
1514
"they match. ::"
1514
1515
msgstr ""
1515
- "以符合守則的方式翻譯如下:有括弧主分組 ``'('``, ``')'`` "
1516
+ "以符合守則的方式翻譯如下:有括弧主分組 ``'('`` , ``')'`` "
1516
1517
"捕捉了匹配文本的開始與結束索引,可透過向 :meth:`~re.Match.group`、:meth:`~re."
1517
1518
"Match.start`、:meth:`~re.Match.end` 和:meth:`~re.Match.span` "
1518
1519
"中傳入參數獲取此訊息。 主分組以 0 開始編號,因此第一個是 "
1519
1520
"0,代表整個正規表示式(RE),所以當透過 :ref:`match object <match-objects>` "
1520
1521
"方法時預設值皆會回傳主分組 0。 "
1521
- "後續我們也會看到如何表示不包含其匹配範圍但需要群聚化的案例. ::"
1522
+ "後續我們也會看到如何表示不包含其匹配範圍但需要群聚化的案例。\n"
1523
+ "\n"
1524
+ "::"
1522
1525
1523
1526
#: ../../howto/regex.rst:830
1524
- #, fuzzy
1525
1527
msgid ""
1526
1528
"Subgroups are numbered from left to right, from 1 upward. Groups can be "
1527
1529
"nested; to determine the number, just count the opening parenthesis "
1528
1530
"characters, going from left to right. ::"
1529
1531
msgstr ""
1530
1532
"子群組自左而右,由1開始進行編號。此外,群組還可以嵌套;想要確定嵌套數量時,只"
1531
- "需要從左至右計算開啟括號的個數即可。::(註:原文中的冒號符號是保留rst格式用法"
1532
- ",在之前加上了反斜槓表示轉譯)"
1533
+ "需要從左至右計算開啟括號的個數即可。\n"
1534
+ "\n"
1535
+ "::"
1533
1536
1534
1537
#: ../../howto/regex.rst:843
1535
1538
#, fuzzy
@@ -1541,17 +1544,15 @@ msgstr ":meth:`~re.Match.group` "
1541
1544
"可以同時傳入多個群組編號,這樣它會回傳包含這些群組對應數值的元组。"
1542
1545
1543
1546
#: ../../howto/regex.rst:849
1544
- #, fuzzy
1545
1547
msgid ""
1546
1548
"The :meth:`~re.Match.groups` method returns a tuple containing the strings "
1547
1549
"for all the subgroups, from 1 up to however many there are. ::"
1548
1550
msgstr ""
1549
1551
":meth:`~re.Match.groups` "
1550
- "方法會傳回一個元組 (tuple),裡面包含所有子群組(subgroups)所對應的字串,從 "
1551
- "1 到數量上限不等。"
1552
+ "會傳回一個元組 (tuple),裡面包含所有子群組(subgroups)所對應的字串,從 1 "
1553
+ "到數量上限不等。"
1552
1554
1553
1555
#: ../../howto/regex.rst:855
1554
- #, fuzzy
1555
1556
msgid ""
1556
1557
"Backreferences in a pattern allow you to specify that the contents of an "
1557
1558
"earlier capturing group must also be found at the current location in the "
@@ -1562,29 +1563,27 @@ msgid ""
1562
1563
"when incorporating backreferences in a RE."
1563
1564
msgstr ""
1564
1565
"在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字串的當前位置也存在。例"
1565
- "如,若精確內容與第一個群組相符合,則「 \\ 1」 將會成功;反之失敗。請記得 Python "
1566
- "字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
1566
+ "如,若精確內容與第一個群組相符合,則 `` \\ 1`` 將會成功;反之失敗。請記得 "
1567
+ "Python 字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
1567
1568
"中嵌入回溯參照時要用原始字串表達法(raw string)。"
1568
1569
1569
1570
#: ../../howto/regex.rst:863
1570
- #, fuzzy
1571
1571
msgid "For example, the following RE detects doubled words in a string. ::"
1572
1572
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
+ ":: "
1576
1576
1577
1577
#: ../../howto/regex.rst:869
1578
- #, fuzzy
1579
1578
msgid ""
1580
1579
"Backreferences like this aren't often useful for just searching through a "
1581
1580
"string --- there are few text formats which repeat data in this way --- but "
1582
1581
"you'll soon find out that they're *very* useful when performing string "
1583
1582
"substitutions."
1584
1583
msgstr ""
1585
1584
"像這樣的反向參照通常對於只是搜尋字串來說並不常用 --- "
1586
- "很少有文字格式會以此方式重複數據 --- "
1587
- "但當你執行字串取代時,就很快發現它們 *非常*有用。"
1585
+ "很少有文字格式會以此方式重複數據 --- 但當你執行字串取代時,就很快發現它們 "
1586
+ "*非常* 有用。"
1588
1587
1589
1588
#: ../../howto/regex.rst:875
1590
1589
#, fuzzy
0 commit comments