@@ -10,8 +10,8 @@ msgstr ""
10
10
"Project-Id-Version : Python 3.11\n "
11
11
"Report-Msgid-Bugs-To : \n "
12
12
"POT-Creation-Date : 2022-10-15 20:43+0000\n "
13
- "PO-Revision-Date : 2023-05-05 11 :57+0000\n "
14
- "Last-Translator : Josix <josixwang @gmail.com>\n "
13
+ "PO-Revision-Date : 2023-05-05 12 :57+0000\n "
14
+ "Last-Translator : raymond <raymond727341 @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 "
@@ -1001,7 +1001,7 @@ msgstr ""
1001
1001
1002
1002
#: ../../howto/regex.rst:523
1003
1003
msgid "Compilation Flags"
1004
- msgstr "編譯旗幟 "
1004
+ msgstr "編譯標誌 "
1005
1005
1006
1006
#: ../../howto/regex.rst:525
1007
1007
msgid ""
@@ -1025,11 +1025,11 @@ msgstr ""
1025
1025
msgid ""
1026
1026
"Here's a table of the available flags, followed by a more detailed "
1027
1027
"explanation of each one."
1028
- msgstr "下表列出了可用的旗幟,接下來是每個旗幟的詳細說明 。"
1028
+ msgstr "下表列出了可用的標誌,接下來是每個標誌的詳細說明 。"
1029
1029
1030
1030
#: ../../howto/regex.rst:537
1031
1031
msgid "Flag"
1032
- msgstr "旗幟 "
1032
+ msgstr "標誌 "
1033
1033
1034
1034
#: ../../howto/regex.rst:537
1035
1035
msgid "Meaning"
@@ -1357,9 +1357,8 @@ msgid "``\\Z``"
1357
1357
msgstr "``\\ Z``"
1358
1358
1359
1359
#: ../../howto/regex.rst:741
1360
- #, fuzzy
1361
1360
msgid "Matches only at the end of the string."
1362
- msgstr "僅在字串結尾進行匹配 。"
1361
+ msgstr "只在字串結尾進行匹配 。"
1363
1362
1364
1363
#: ../../howto/regex.rst:776
1365
1364
msgid "``\\ b``"
@@ -1372,16 +1371,16 @@ msgid ""
1372
1371
"characters, so the end of a word is indicated by whitespace or a non-"
1373
1372
"alphanumeric character."
1374
1373
msgstr ""
1375
- "單字邊界,是一個零寬度斷言 (zero-width "
1376
- "assertion),只會在單詞的開頭或結尾符合。 單字指的是由英文字母和阿拉伯數字所 "
1377
- "構成的序列,因此單字的結尾必須以空格或非英數字符號來表示 。"
1374
+ "單字邊界,是一個只會在單詞的開頭或結尾符合的零寬度斷言 (zero-width "
1375
+ "assertion)。 單字指的是由英文字母和阿拉伯數字所構成的序列,因此單字的結尾必 "
1376
+ "須以空格或非英數字符號來表示 。"
1378
1377
1379
1378
#: ../../howto/regex.rst:749
1380
1379
msgid ""
1381
1380
"The following example matches ``class`` only when it's a complete word; it "
1382
1381
"won't match when it's contained inside another word. ::"
1383
- msgstr "以下範例只會比對「 ``class`` "
1384
- "」是否為一個完整的單字,當它包含在其他單字中時則不會比對到 。 ::"
1382
+ msgstr "以下範例只會在當他是一個完整的單字時匹配 ``class`` "
1383
+ ",當它包含在其他單字中時則不會匹配到 。 ::"
1385
1384
1386
1385
#: ../../howto/regex.rst:760
1387
1386
msgid ""
@@ -1396,18 +1395,16 @@ msgstr ""
1396
1395
"使用這個特殊序列時,請注意兩點細節。首先,這是 Python "
1397
1396
"字串文字和正則表達式序列之間最嚴重的衝突。在 Python 字串文字中, ``\\ b`` "
1398
1397
"是回退字符(ASCII 值為 8)。如果沒有使用原始字串,那麼 Python 會將 ``\\ b`` "
1399
- "轉換為回退鍵,而正則表達式不會按預期匹配。以下實例看起來與我們之前的 RE "
1400
- "相同,但省略了 RE 字符串前面的 ``'r'`` 。\n"
1401
- "\n"
1402
- "::"
1398
+ "轉換為回退鍵,而正則表達式不會如預期匹配。以下實例看起來與我們之前的 RE "
1399
+ "相同,但省略了 RE 字符串前面的 ``'r'`` 。::"
1403
1400
1404
1401
#: ../../howto/regex.rst:774
1405
1402
msgid ""
1406
1403
"Second, inside a character class, where there's no use for this assertion, ``"
1407
1404
"\\ b`` represents the backspace character, for compatibility with Python's "
1408
1405
"string literals."
1409
- msgstr "第二點, 在字元類別中,如果不需要這個斷言,``\\ b`` "
1410
- "代表的是回退符號(backspace),為了與 Python 的字串表示法相容 。"
1406
+ msgstr "其次; 在字元類別中,如果不需要這個斷言,為了與 Python 的字串表示法相容, ``\\ b"
1407
+ "`` 代表的是回退符號(backspace)。"
1411
1408
1412
1409
#: ../../howto/regex.rst:781
1413
1410
msgid "``\\ B``"
@@ -1417,13 +1414,12 @@ msgstr "``\\B``"
1417
1414
msgid ""
1418
1415
"Another zero-width assertion, this is the opposite of ``\\ b``, only matching "
1419
1416
"when the current position is not at a word boundary."
1420
- msgstr "另一個零寬度斷言(zero-width assertion),這是 ``\\ b`` "
1417
+ msgstr "另一個零寬度斷言(zero-width assertion),是 ``\\ b`` "
1421
1418
"的相反,僅在當前位置不位於單字邊界時匹配。"
1422
1419
1423
1420
#: ../../howto/regex.rst:784
1424
- #, fuzzy
1425
1421
msgid "Grouping"
1426
- msgstr "群組化 "
1422
+ msgstr "分組 "
1427
1423
1428
1424
#: ../../howto/regex.rst:786
1429
1425
msgid ""
@@ -1433,14 +1429,11 @@ msgid ""
1433
1429
"of interest. For example, an RFC-822 header line is divided into a header "
1434
1430
"name and a value, separated by a ``':'``, like this:"
1435
1431
msgstr ""
1436
- "常常需要取得比僅僅判斷正規表達式是否符合的更多資訊。經常用來剖析字串的方式是"
1437
- "撰寫一個正規表示式,其中包含許多子組,可以匹配各種不同的所需元素。例如,RFC-8"
1438
- "22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰\n"
1439
- "\n"
1440
- "::"
1432
+ "常常需要取得比只是判斷正規表達式是否符合更多的資訊。正則表達式經常被用來解析"
1433
+ "字串,通過定義被分成多個子組的正則表達式來匹配不同感興趣的元件。例如,RFC-822"
1434
+ "標題行可分成一個標頭名稱和一個值,由':'分隔開來︰::"
1441
1435
1442
1436
#: ../../howto/regex.rst:799
1443
- #, fuzzy
1444
1437
msgid ""
1445
1438
"This can be handled by writing a regular expression which matches an entire "
1446
1439
"header line, and has one group which matches the header name, and another "
@@ -1457,12 +1450,10 @@ msgid ""
1457
1450
"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more "
1458
1451
"repetitions of ``ab``. ::"
1459
1452
msgstr ""
1460
- "群組由 ``'('`` 和 ``')'`` 元字符標記。 在數學表達式中,``'('``和 ``')'`` "
1461
- "具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如 ``*``"
1462
- " 、 ``+`` 、 ``?``或 `{m,n}`)重複群組內容。 例如, ``(ab}*`` "
1463
- "可以匹配零個或多個 ``ab`` 。\n"
1464
- "\n"
1465
- "::"
1453
+ "群組由``'('``和 ``')'`` 以及元字符標記。``'('`` 和 ``')'``的意義與它們在數學"
1454
+ "表達式中的意義差不多;它們將其中包含的表達式分組在一起,並且您可以使用量詞("
1455
+ "如``*``, ``+``, ``?``或``{m,n}``)重複群組內容。例如, "
1456
+ "``(ab)*``將匹配零個或多個``ab``的重複。 ::"
1466
1457
1467
1458
#: ../../howto/regex.rst:814
1468
1459
msgid ""
@@ -1475,44 +1466,38 @@ msgid ""
1475
1466
"we'll see how to express groups that don't capture the span of text that "
1476
1467
"they match. ::"
1477
1468
msgstr ""
1478
- "以符合守則的方式翻譯如下:有括弧主分組 ``'('`` , ``')'`` "
1479
- "捕捉了匹配文本的開始與結束索引,可透過向 :meth:`~re.Match.group`、:meth:`~re."
1480
- "Match.start`、:meth:`~re.Match.end` 和:meth:`~re.Match.span` "
1481
- "中傳入參數獲取此訊息。 主分組以 0 開始編號,因此第一個是 "
1482
- "0,代表整個正規表示式(RE),所以當透過 :ref:`match object <match-objects>` "
1483
- "方法時預設值皆會回傳主分組 0。 "
1484
- "後續我們也會看到如何表示不包含其匹配範圍但需要群聚化的案例。\n"
1485
- "\n"
1486
- "::"
1469
+ "用``'('``和``')'``標記的群組也會捕獲它們匹配文本的開始和結束索引;"
1470
+ "這可以通過向 :meth:~re.Match.group、:meth:~re.Match.start、:meth:~"
1471
+ "re.Match.end 和 :meth:~re.Match.span 傳遞參數來檢索。群組從 0 開始編號。群組 "
1472
+ "0 始終存在;它是整個正則表達式,因此 :ref:匹配對象 <match-objects> "
1473
+ "方法的默認參數都是群組 "
1474
+ "0。稍後我們將看到如何表示不捕獲它們匹配的文本範圍的群組。 ::"
1487
1475
1488
1476
#: ../../howto/regex.rst:830
1489
1477
msgid ""
1490
1478
"Subgroups are numbered from left to right, from 1 upward. Groups can be "
1491
1479
"nested; to determine the number, just count the opening parenthesis "
1492
1480
"characters, going from left to right. ::"
1493
- msgstr ""
1494
- "子群組自左而右,由1開始進行編號。此外,群組還可以嵌套;想要確定嵌套數量時,只"
1495
- "需要從左至右計算開啟括號的個數即可。\n"
1496
- "\n"
1481
+ msgstr "子群組從左到右從 1 "
1482
+ "開始編號。群組可以嵌套;要確定數量,只需從左到右計算開始括號字符的數量即可。 "
1497
1483
"::"
1498
1484
1499
1485
#: ../../howto/regex.rst:843
1500
- #, fuzzy
1501
1486
msgid ""
1502
1487
":meth:`~re.Match.group` can be passed multiple group numbers at a time, in "
1503
1488
"which case it will return a tuple containing the corresponding values for "
1504
1489
"those groups. ::"
1505
1490
msgstr ":meth:`~re.Match.group` "
1506
- "可以同時傳入多個群組編號,這樣它會回傳包含這些群組對應數值的元组。 "
1491
+ "可以一次傳遞多個群組編號,此時它會返回一個元組,其中包含這些群組對應的值。:: "
1507
1492
1508
1493
#: ../../howto/regex.rst:849
1509
1494
msgid ""
1510
1495
"The :meth:`~re.Match.groups` method returns a tuple containing the strings "
1511
1496
"for all the subgroups, from 1 up to however many there are. ::"
1512
1497
msgstr ""
1513
1498
":meth:`~re.Match.groups` "
1514
- "會傳回一個元組(tuple),裡面包含所有子群組 (subgroups)所對應的字串,從 1 "
1515
- "到數量上限不等 。"
1499
+ "會傳回一個元組(tuple),其中包含所有子群組 (subgroups)所對應的字串,從 "
1500
+ "1一直到最後一個子群組 。"
1516
1501
1517
1502
#: ../../howto/regex.rst:855
1518
1503
msgid ""
@@ -1524,31 +1509,26 @@ msgid ""
1524
1509
"including arbitrary characters in a string, so be sure to use a raw string "
1525
1510
"when incorporating backreferences in a RE."
1526
1511
msgstr ""
1527
- "在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字串的當前位置也存在 。例"
1528
- "如,若精確內容與第一個群組相符合,則 `` \\ 1`` 將會成功;反之失敗。請記得 "
1529
- "Python 字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
1530
- "中嵌入回溯參照時要用原始字串表達法(raw string) 。"
1512
+ "在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字符串的當前位置找到 。例"
1513
+ "如,如果可以在當前位置找到群組 1 的內容,則「 \\ 1」將成功,否則失敗。請記住, "
1514
+ "Python 的字符串文字也使用反斜杠後跟數字來允許在字符串中包含任意字符, "
1515
+ "因此在將反向引用包含在 RE 中時,請務必使用原始字符串 。"
1531
1516
1532
1517
#: ../../howto/regex.rst:863
1533
1518
msgid "For example, the following RE detects doubled words in a string. ::"
1534
- msgstr ""
1535
- "例如,以下的正規表示式可以在一個字串中偵測出重複的單詞。\n"
1536
- "\n"
1537
- "::"
1519
+ msgstr "舉例來說,以下的正規表示式可以在一個字串中偵測出重複的單詞。::"
1538
1520
1539
1521
#: ../../howto/regex.rst:869
1540
1522
msgid ""
1541
1523
"Backreferences like this aren't often useful for just searching through a "
1542
1524
"string --- there are few text formats which repeat data in this way --- but "
1543
1525
"you'll soon find out that they're *very* useful when performing string "
1544
1526
"substitutions."
1545
- msgstr ""
1546
- "像這樣的反向參照通常對於只是搜尋字串來說並不常用 --- "
1547
- "很少有文字格式會以此方式重複數據 --- 但當你執行字串取代時,就很快發現它們 "
1548
- "*非常* 有用。"
1527
+ msgstr "像這樣的回溯參照通常不常用於只是搜尋字串 --- "
1528
+ "很少有文本格式會以此方式重複數據 --- "
1529
+ "但是在您執行字符串替換時很快就會發現它們非常有用。"
1549
1530
1550
1531
#: ../../howto/regex.rst:875
1551
- #, fuzzy
1552
1532
msgid "Non-capturing and Named Groups"
1553
1533
msgstr "非捕獲和命名群組"
1554
1534
@@ -2367,16 +2347,15 @@ msgstr ""
2367
2347
"串,使其很難理解和閱讀。"
2368
2348
2369
2349
#: ../../howto/regex.rst:1353
2370
- #, fuzzy
2371
2350
msgid ""
2372
2351
"For such REs, specifying the :const:`re.VERBOSE` flag when compiling the "
2373
2352
"regular expression can be helpful, because it allows you to format the "
2374
2353
"regular expression more clearly."
2375
- msgstr "對於這樣的正規表示式(REs),在編譯時指定:const:`re.VERBOSE` "
2376
- "標誌可以很有幫助,因為它允許您更清晰地格式化正則表達式。"
2354
+ msgstr ""
2355
+ "對於這樣的正規表示式(REs),當編譯正則表達式時指定:const:`re.VERBOSE` "
2356
+ "標誌可能會有所幫助,因為它允許您更清晰地格式化正則表達式。"
2377
2357
2378
2358
#: ../../howto/regex.rst:1357
2379
- #, fuzzy
2380
2359
msgid ""
2381
2360
"The ``re.VERBOSE`` flag has several effects. Whitespace in the regular "
2382
2361
"expression that *isn't* inside a character class is ignored. This means "
@@ -2390,35 +2369,28 @@ msgstr ""
2390
2369
"標誌有數個效果。正規表達式中的空白字符(這**不在**字符類中)將被忽略。"
2391
2370
"這意味著像 ``dog | cat`` 這樣子的表示也等同於比較難讀的寫法: \\ ```dog|cat\\ "
2392
2371
"``` ,但是 ``[a b]`` 仍然可以匹配到'`a`', "
2393
- "`'b'`或一個空格。此外,您也可以將註釋放入正則表達式內部;註釋從其中一個“#” "
2394
- "字符開始,直到下一行新行為止長度和位置沒有限制,可以自由嵌套和換行使用。\\ "
2395
- "如舉例:`\\\\\\\\ ```pythonpattern = re.compile(r''' (\\ d+) # capture one or "
2396
- "more digits [-/+]? # an optional minus or plus sign (\\ d+) # capture one "
2397
- "or more digits''', re.VERBOSE)``當用於三引號字符串時,它使得 REs "
2398
- "可以更整齊地排版:"
2372
+ "`'b'`或一個空格。此外,您還可以在正則表達式中添加註釋;註釋從 ``#``字符一直延"
2373
+ "伸到下一個換行符。當與三重引號字符串一起使用時,這使得正則表達式可以更整潔地"
2374
+ "格式化:"
2399
2375
2400
2376
#: ../../howto/regex.rst:1374
2401
- #, fuzzy
2402
2377
msgid "This is far more readable than::"
2403
- msgstr "這樣閱讀起來會輕鬆許多::: 這遠比以下方式容易閱讀: "
2378
+ msgstr "這樣比較易讀:: "
2404
2379
2405
2380
#: ../../howto/regex.rst:1380
2406
- #, fuzzy
2407
2381
msgid "Feedback"
2408
2382
msgstr "回饋"
2409
2383
2410
2384
#: ../../howto/regex.rst:1382
2411
- #, fuzzy
2412
2385
msgid ""
2413
2386
"Regular expressions are a complicated topic. Did this document help you "
2414
2387
"understand them? Were there parts that were unclear, or Problems you "
2415
2388
"encountered that weren't covered here? If so, please send suggestions for "
2416
2389
"improvements to the author."
2417
2390
msgstr "正規表示式是一個複雜的主題。 這份文件有幫助您了解嗎? "
2418
- "是否有部分不清楚或未涵蓋到問題? 如果有 ,請將改進建議發送給作者。"
2391
+ "是否有部分不清楚或未涵蓋到的問題? 如果有的話 ,請將改進建議發送給作者。"
2419
2392
2420
2393
#: ../../howto/regex.rst:1387
2421
- #, fuzzy
2422
2394
msgid ""
2423
2395
"The most complete book on regular expressions is almost certainly Jeffrey "
2424
2396
"Friedl's Mastering Regular Expressions, published by O'Reilly. "
0 commit comments