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

Skip to content

Commit 4098f43

Browse files
mingray0121weblate
authored andcommitted
Translated using Weblate (regex (generated) (regex))
Currently translated at 93.0% (266 of 286 strings) Translation: python-doc-zhtw/howto Translate-URL: http://weblate.andyjjrt.cc/projects/python-doc-zhtw/howto/regex/
1 parent 2584f43 commit 4098f43

File tree

1 file changed

+51
-79
lines changed

1 file changed

+51
-79
lines changed

howto/regex.po

Lines changed: 51 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ msgstr ""
1010
"Project-Id-Version: Python 3.11\n"
1111
"Report-Msgid-Bugs-To: \n"
1212
"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"
1515
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-tw)"
1616
"\n"
1717
"Language: regex\n"
@@ -1001,7 +1001,7 @@ msgstr ""
10011001

10021002
#: ../../howto/regex.rst:523
10031003
msgid "Compilation Flags"
1004-
msgstr "編譯旗幟"
1004+
msgstr "編譯標誌"
10051005

10061006
#: ../../howto/regex.rst:525
10071007
msgid ""
@@ -1025,11 +1025,11 @@ msgstr ""
10251025
msgid ""
10261026
"Here's a table of the available flags, followed by a more detailed "
10271027
"explanation of each one."
1028-
msgstr "下表列出了可用的旗幟,接下來是每個旗幟的詳細說明。"
1028+
msgstr "下表列出了可用的標誌,接下來是每個標誌的詳細說明。"
10291029

10301030
#: ../../howto/regex.rst:537
10311031
msgid "Flag"
1032-
msgstr "旗幟"
1032+
msgstr "標誌"
10331033

10341034
#: ../../howto/regex.rst:537
10351035
msgid "Meaning"
@@ -1357,9 +1357,8 @@ msgid "``\\Z``"
13571357
msgstr "``\\Z``"
13581358

13591359
#: ../../howto/regex.rst:741
1360-
#, fuzzy
13611360
msgid "Matches only at the end of the string."
1362-
msgstr "僅在字串結尾進行匹配。"
1361+
msgstr "只在字串結尾進行匹配。"
13631362

13641363
#: ../../howto/regex.rst:776
13651364
msgid "``\\b``"
@@ -1372,16 +1371,16 @@ msgid ""
13721371
"characters, so the end of a word is indicated by whitespace or a non-"
13731372
"alphanumeric character."
13741373
msgstr ""
1375-
"單字邊界,是一個零寬度斷言(zero-width "
1376-
"assertion),只會在單詞的開頭或結尾符合。 單字指的是由英文字母和阿拉伯數字所"
1377-
"構成的序列,因此單字的結尾必須以空格或非英數字符號來表示。"
1374+
"單字邊界,是一個只會在單詞的開頭或結尾符合的零寬度斷言(zero-width "
1375+
"assertion)。 單字指的是由英文字母和阿拉伯數字所構成的序列,因此單字的結尾必"
1376+
"須以空格或非英數字符號來表示。"
13781377

13791378
#: ../../howto/regex.rst:749
13801379
msgid ""
13811380
"The following example matches ``class`` only when it's a complete word; it "
13821381
"won't match when it's contained inside another word. ::"
1383-
msgstr "以下範例只會比對「 ``class`` "
1384-
"」是否為一個完整的單字,當它包含在其他單字中時則不會比對到。 ::"
1382+
msgstr "以下範例只會在當他是一個完整的單字時匹配``class`` "
1383+
",當它包含在其他單字中時則不會匹配到。 ::"
13851384

13861385
#: ../../howto/regex.rst:760
13871386
msgid ""
@@ -1396,18 +1395,16 @@ msgstr ""
13961395
"使用這個特殊序列時,請注意兩點細節。首先,這是 Python "
13971396
"字串文字和正則表達式序列之間最嚴重的衝突。在 Python 字串文字中, ``\\b`` "
13981397
"是回退字符(ASCII 值為 8)。如果沒有使用原始字串,那麼 Python 會將 ``\\b`` "
1399-
"轉換為回退鍵,而正則表達式不會按預期匹配。以下實例看起來與我們之前的 RE "
1400-
"相同,但省略了 RE 字符串前面的 ``'r'`` 。\n"
1401-
"\n"
1402-
"::"
1398+
"轉換為回退鍵,而正則表達式不會如預期匹配。以下實例看起來與我們之前的 RE "
1399+
"相同,但省略了 RE 字符串前面的 ``'r'`` 。::"
14031400

14041401
#: ../../howto/regex.rst:774
14051402
msgid ""
14061403
"Second, inside a character class, where there's no use for this assertion, ``"
14071404
"\\b`` represents the backspace character, for compatibility with Python's "
14081405
"string literals."
1409-
msgstr "第二點,在字元類別中,如果不需要這個斷言,``\\b`` "
1410-
"代表的是回退符號(backspace),為了與 Python 的字串表示法相容。"
1406+
msgstr "其次;在字元類別中,如果不需要這個斷言,為了與 Python 的字串表示法相容,``\\b"
1407+
"`` 代表的是回退符號(backspace)。"
14111408

14121409
#: ../../howto/regex.rst:781
14131410
msgid "``\\B``"
@@ -1417,13 +1414,12 @@ msgstr "``\\B``"
14171414
msgid ""
14181415
"Another zero-width assertion, this is the opposite of ``\\b``, only matching "
14191416
"when the current position is not at a word boundary."
1420-
msgstr "另一個零寬度斷言(zero-width assertion),這是 ``\\b`` "
1417+
msgstr "另一個零寬度斷言(zero-width assertion), ``\\b`` "
14211418
"的相反,僅在當前位置不位於單字邊界時匹配。"
14221419

14231420
#: ../../howto/regex.rst:784
1424-
#, fuzzy
14251421
msgid "Grouping"
1426-
msgstr "群組化"
1422+
msgstr "分組"
14271423

14281424
#: ../../howto/regex.rst:786
14291425
msgid ""
@@ -1433,14 +1429,11 @@ msgid ""
14331429
"of interest. For example, an RFC-822 header line is divided into a header "
14341430
"name and a value, separated by a ``':'``, like this:"
14351431
msgstr ""
1436-
"常常需要取得比僅僅判斷正規表達式是否符合的更多資訊。經常用來剖析字串的方式是"
1437-
"撰寫一個正規表示式,其中包含許多子組,可以匹配各種不同的所需元素。例如,RFC-8"
1438-
"22標頭行可分成一個標頭名稱和一個值,由冒號「:」分隔開來︰\n"
1439-
"\n"
1440-
"::"
1432+
"常常需要取得比只是判斷正規表達式是否符合更多的資訊。正則表達式經常被用來解析"
1433+
"字串,通過定義被分成多個子組的正則表達式來匹配不同感興趣的元件。例如,RFC-822"
1434+
"標題行可分成一個標頭名稱和一個值,由':'分隔開來︰::"
14411435

14421436
#: ../../howto/regex.rst:799
1443-
#, fuzzy
14441437
msgid ""
14451438
"This can be handled by writing a regular expression which matches an entire "
14461439
"header line, and has one group which matches the header name, and another "
@@ -1457,12 +1450,10 @@ msgid ""
14571450
"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more "
14581451
"repetitions of ``ab``. ::"
14591452
msgstr ""
1460-
"群組由 ``'('`` 和 ``')'`` 元字符標記。 在數學表達式中,``'('``和 ``')'`` "
1461-
"具有大致相同的含義; 它們將其中包含的表達式分組在一起,可以使用量詞(如 ``*``"
1462-
" 、 ``+`` 、 ``?``或 `{m,n}`)重複群組內容。 例如, ``(ab}*`` "
1463-
"可以匹配零個或多個 ``ab`` 。\n"
1464-
"\n"
1465-
"::"
1453+
"群組由``'('``和 ``')'`` 以及元字符標記。``'('`` 和 ``')'``的意義與它們在數學"
1454+
"表達式中的意義差不多;它們將其中包含的表達式分組在一起,並且您可以使用量詞("
1455+
"如``*``, ``+``, ``?``或``{m,n}``)重複群組內容。例如, "
1456+
"``(ab)*``將匹配零個或多個``ab``的重複。 ::"
14661457

14671458
#: ../../howto/regex.rst:814
14681459
msgid ""
@@ -1475,44 +1466,38 @@ msgid ""
14751466
"we'll see how to express groups that don't capture the span of text that "
14761467
"they match. ::"
14771468
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。稍後我們將看到如何表示不捕獲它們匹配的文本範圍的群組。 ::"
14871475

14881476
#: ../../howto/regex.rst:830
14891477
msgid ""
14901478
"Subgroups are numbered from left to right, from 1 upward. Groups can be "
14911479
"nested; to determine the number, just count the opening parenthesis "
14921480
"characters, going from left to right. ::"
1493-
msgstr ""
1494-
"子群組自左而右,由1開始進行編號。此外,群組還可以嵌套;想要確定嵌套數量時,只"
1495-
"需要從左至右計算開啟括號的個數即可。\n"
1496-
"\n"
1481+
msgstr "子群組從左到右從 1 "
1482+
"開始編號。群組可以嵌套;要確定數量,只需從左到右計算開始括號字符的數量即可。 "
14971483
"::"
14981484

14991485
#: ../../howto/regex.rst:843
1500-
#, fuzzy
15011486
msgid ""
15021487
":meth:`~re.Match.group` can be passed multiple group numbers at a time, in "
15031488
"which case it will return a tuple containing the corresponding values for "
15041489
"those groups. ::"
15051490
msgstr ":meth:`~re.Match.group` "
1506-
"可以同時傳入多個群組編號,這樣它會回傳包含這些群組對應數值的元组。"
1491+
"可以一次傳遞多個群組編號,此時它會返回一個元組,其中包含這些群組對應的值。::"
15071492

15081493
#: ../../howto/regex.rst:849
15091494
msgid ""
15101495
"The :meth:`~re.Match.groups` method returns a tuple containing the strings "
15111496
"for all the subgroups, from 1 up to however many there are. ::"
15121497
msgstr ""
15131498
":meth:`~re.Match.groups` "
1514-
"會傳回一個元組(tuple),裡面包含所有子群組(subgroups)所對應的字串,從 1 "
1515-
"到數量上限不等。"
1499+
"會傳回一個元組(tuple),其中包含所有子群組(subgroups)所對應的字串,從 "
1500+
"1一直到最後一個子群組。"
15161501

15171502
#: ../../howto/regex.rst:855
15181503
msgid ""
@@ -1524,31 +1509,26 @@ msgid ""
15241509
"including arbitrary characters in a string, so be sure to use a raw string "
15251510
"when incorporating backreferences in a RE."
15261511
msgstr ""
1527-
"在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字串的當前位置也存在。例"
1528-
"如,若精確內容與第一個群組相符合,則 ``\\1`` 將會成功;反之失敗。請記得 "
1529-
"Python 字串面值也使用反斜槓後接數字來包含任意字元,因此在正規表示式 (RE) "
1530-
"中嵌入回溯參照時要用原始字串表達法(raw string)。"
1512+
"在模式中使用回溯參照可讓你指定早期捕獲組的內容必須在字符串的當前位置找到。例"
1513+
"如,如果可以在當前位置找到群組 1 的內容,則「\\1」將成功,否則失敗。請記住,"
1514+
"Python 的字符串文字也使用反斜杠後跟數字來允許在字符串中包含任意字符,"
1515+
"因此在將反向引用包含在 RE 中時,請務必使用原始字符串。"
15311516

15321517
#: ../../howto/regex.rst:863
15331518
msgid "For example, the following RE detects doubled words in a string. ::"
1534-
msgstr ""
1535-
"例如,以下的正規表示式可以在一個字串中偵測出重複的單詞。\n"
1536-
"\n"
1537-
"::"
1519+
msgstr "舉例來說,以下的正規表示式可以在一個字串中偵測出重複的單詞。::"
15381520

15391521
#: ../../howto/regex.rst:869
15401522
msgid ""
15411523
"Backreferences like this aren't often useful for just searching through a "
15421524
"string --- there are few text formats which repeat data in this way --- but "
15431525
"you'll soon find out that they're *very* useful when performing string "
15441526
"substitutions."
1545-
msgstr ""
1546-
"像這樣的反向參照通常對於只是搜尋字串來說並不常用 --- "
1547-
"很少有文字格式會以此方式重複數據 --- 但當你執行字串取代時,就很快發現它們 "
1548-
"*非常* 有用。"
1527+
msgstr "像這樣的回溯參照通常不常用於只是搜尋字串 --- "
1528+
"很少有文本格式會以此方式重複數據 --- "
1529+
"但是在您執行字符串替換時很快就會發現它們非常有用。"
15491530

15501531
#: ../../howto/regex.rst:875
1551-
#, fuzzy
15521532
msgid "Non-capturing and Named Groups"
15531533
msgstr "非捕獲和命名群組"
15541534

@@ -2367,16 +2347,15 @@ msgstr ""
23672347
"串,使其很難理解和閱讀。"
23682348

23692349
#: ../../howto/regex.rst:1353
2370-
#, fuzzy
23712350
msgid ""
23722351
"For such REs, specifying the :const:`re.VERBOSE` flag when compiling the "
23732352
"regular expression can be helpful, because it allows you to format the "
23742353
"regular expression more clearly."
2375-
msgstr "對於這樣的正規表示式(REs),在編譯時指定:const:`re.VERBOSE` "
2376-
"標誌可以很有幫助,因為它允許您更清晰地格式化正則表達式。"
2354+
msgstr ""
2355+
"對於這樣的正規表示式(REs),當編譯正則表達式時指定:const:`re.VERBOSE` "
2356+
"標誌可能會有所幫助,因為它允許您更清晰地格式化正則表達式。"
23772357

23782358
#: ../../howto/regex.rst:1357
2379-
#, fuzzy
23802359
msgid ""
23812360
"The ``re.VERBOSE`` flag has several effects. Whitespace in the regular "
23822361
"expression that *isn't* inside a character class is ignored. This means "
@@ -2390,35 +2369,28 @@ msgstr ""
23902369
"標誌有數個效果。正規表達式中的空白字符(這**不在**字符類中)將被忽略。"
23912370
"這意味著像 ``dog | cat`` 這樣子的表示也等同於比較難讀的寫法: \\```dog|cat\\"
23922371
"``` ,但是 ``[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+
"格式化:"
23992375

24002376
#: ../../howto/regex.rst:1374
2401-
#, fuzzy
24022377
msgid "This is far more readable than::"
2403-
msgstr "這樣閱讀起來會輕鬆許多::: 這遠比以下方式容易閱讀:"
2378+
msgstr "這樣比較易讀::"
24042379

24052380
#: ../../howto/regex.rst:1380
2406-
#, fuzzy
24072381
msgid "Feedback"
24082382
msgstr "回饋"
24092383

24102384
#: ../../howto/regex.rst:1382
2411-
#, fuzzy
24122385
msgid ""
24132386
"Regular expressions are a complicated topic. Did this document help you "
24142387
"understand them? Were there parts that were unclear, or Problems you "
24152388
"encountered that weren't covered here? If so, please send suggestions for "
24162389
"improvements to the author."
24172390
msgstr "正規表示式是一個複雜的主題。 這份文件有幫助您了解嗎? "
2418-
"是否有部分不清楚或未涵蓋到問題? 如果有,請將改進建議發送給作者。"
2391+
"是否有部分不清楚或未涵蓋到的問題? 如果有的話,請將改進建議發送給作者。"
24192392

24202393
#: ../../howto/regex.rst:1387
2421-
#, fuzzy
24222394
msgid ""
24232395
"The most complete book on regular expressions is almost certainly Jeffrey "
24242396
"Friedl's Mastering Regular Expressions, published by O'Reilly. "

0 commit comments

Comments
 (0)