From 0f232ab609dc5ef7642b1414a3050a66386439e6 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 20 Nov 2024 17:20:50 +0800 Subject: [PATCH] wip --- library/re.po | 433 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 382 insertions(+), 51 deletions(-) diff --git a/library/re.po b/library/re.po index c5ceb995d2..d5168d98c3 100644 --- a/library/re.po +++ b/library/re.po @@ -1038,49 +1038,65 @@ msgid "Flags" msgstr "旗標" #: ../../library/re.rst:723 +#, fuzzy msgid "" "Flag constants are now instances of :class:`RegexFlag`, which is a subclass " "of :class:`enum.IntFlag`." msgstr "" +"Flag 常數現在是 :class:`RegexFlag` 的實例,而 :class:`enum.IntFlag` 是 :" +"class:`enum.IntFlag` 的子類別。" #: ../../library/re.rst:730 +#, fuzzy msgid "" "An :class:`enum.IntFlag` class containing the regex options listed below." -msgstr "" +msgstr "一個 :class:`enum.IntFlag` 類包含下列 regex 選項。" #: ../../library/re.rst:732 msgid "- added to ``__all__``" -msgstr "" +msgstr "- 新增至 ``__all__``" #: ../../library/re.rst:737 +#, fuzzy msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\d``, ``\\D``, ``\\s`` and " "``\\S`` perform ASCII-only matching instead of full Unicode matching. This " "is only meaningful for Unicode (str) patterns, and is ignored for bytes " "patterns." msgstr "" +"使 ``\\w``、``\\W``、``\\b``、``\\B``、``\\d``、``\\D``、``\\s`` 和 ``\\S` 只" +"執行 ASCII 匹配,而不是完整的 Unicode 匹配。 這只對 Unicode (str) 模式有意" +"義,對 bytes 模式則忽略。" #: ../../library/re.rst:741 +#, fuzzy msgid "Corresponds to the inline flag ``(?a)``." -msgstr "" +msgstr "對應內聯旗標 ``(?a)``。" #: ../../library/re.rst:745 +#, fuzzy msgid "" "The :py:const:`~re.U` flag still exists for backward compatibility, but is " "redundant in Python 3 since matches are Unicode by default for ``str`` " "patterns, and Unicode matching isn't allowed for bytes patterns. :py:const:" "`~re.UNICODE` and the inline flag ``(?u)`` are similarly redundant." msgstr "" +":py:const:`~re.U` 旗標仍然存在是為了向後相容,但在 Python 3 中是多餘的,因為" +"對於 ``str`` 模式,預設匹配是 Unicode,而對於 bytes 模式,Unicode 匹配是不允" +"許的。 :py:const:`~re.UNICODE` 和 inline 旗標 ``(?u)`` 也是類似多餘的。" #: ../../library/re.rst:754 +#, fuzzy msgid "Display debug information about compiled expression." -msgstr "" +msgstr "顯示有關已編譯表達式的除錯資訊。" #: ../../library/re.rst:756 +#, fuzzy msgid "No corresponding inline flag." -msgstr "" +msgstr "沒有對應的內嵌旗標。" #: ../../library/re.rst:762 +#, fuzzy msgid "" "Perform case-insensitive matching; expressions like ``[A-Z]`` will also " "match lowercase letters. Full Unicode matching (such as ``Ü`` matching " @@ -1088,12 +1104,18 @@ msgid "" "non-ASCII matches. The current locale does not change the effect of this " "flag unless the :py:const:`~re.LOCALE` flag is also used." msgstr "" +"執行不區分大小寫的匹配;像``[A-Z]``這類的表達式也會匹配小寫字母。除非使用 :" +"py:const:`~re.ASCII` 旗標禁止非 ASCII 匹配,否則完整的 Unicode 匹配 (例如 " +"``Ü`` 匹配 ``ü``)也會生效。除非同時使用 :py:const:`~re.LOCALE` 旗標,否則目前" +"的 locale 不會改變這個旗標的效果。" #: ../../library/re.rst:770 +#, fuzzy msgid "Corresponds to the inline flag ``(?i)``." -msgstr "" +msgstr "對應內聯旗標 ``(?i)``。" #: ../../library/re.rst:772 +#, fuzzy msgid "" "Note that when the Unicode patterns ``[a-z]`` or ``[A-Z]`` are used in " "combination with the :const:`IGNORECASE` flag, they will match the 52 ASCII " @@ -1103,19 +1125,29 @@ msgid "" "py:const:`~re.ASCII` flag is used, only letters 'a' to 'z' and 'A' to 'Z' " "are matched." msgstr "" +"請注意,當 Unicode 模式 ``[a-z]`` 或 ``[A-Z]`` 與 :const:`IGNORECASE` 旗標結" +"合使用時,它們會匹配 52 個 ASCII 字母和另外 4 個非 ASCII 字母:'İ「 (U+0130, " +"拉丁大寫字母 I 上面有點)、」ı「 (U+0131, 拉丁小寫字母 dotless i)、」ſ" +"「 (U+017F, 拉丁小寫字母 long s) 和 」K' (U+212A, 開爾文符號)。如果使用 :py:" +"const:`~re.ASCII` 旗標,則只會匹配 'a「 到 」z「 和 」A「 到 」Z' 的字母。" #: ../../library/re.rst:783 +#, fuzzy msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale. This flag can be used only with bytes " "patterns." msgstr "" +"使``\\w```, ``\\W``, ``\\b``,``\\B``和大小寫不敏感匹配取決於當前的locale。此" +"旗標只能用於 bytes 模式。" #: ../../library/re.rst:787 +#, fuzzy msgid "Corresponds to the inline flag ``(?L)``." -msgstr "" +msgstr "對應內聯旗標 ``(?L)``。" #: ../../library/re.rst:791 +#, fuzzy msgid "" "This flag is discouraged; consider Unicode matching instead. The locale " "mechanism is very unreliable as it only handles one \"culture\" at a time " @@ -1123,21 +1155,30 @@ msgid "" "for Unicode (str) patterns and it is able to handle different locales and " "languages." msgstr "" +"不鼓勵使用此旗標;請考慮改用 Unicode 匹配。locale 機制非常不可靠,因為它一次" +"只能處理一種「文化」,而且只適用於 8 位元的 locale。對於 Unicode (str) 模式," +"預設會啟用 Unicode 匹配,它能夠處理不同的區域和語言。" #: ../../library/re.rst:798 +#, fuzzy msgid "" ":py:const:`~re.LOCALE` can be used only with bytes patterns and is not " "compatible with :py:const:`~re.ASCII`." msgstr "" +":py:const:`~re.LOCALE` 只能用於 bytes 模式,與 :py:const:`~re.ASCII` 不相容。" #: ../../library/re.rst:802 +#, fuzzy msgid "" "Compiled regular expression objects with the :py:const:`~re.LOCALE` flag no " "longer depend on the locale at compile time. Only the locale at matching " "time affects the result of matching." msgstr "" +"使用 :py:const:`~re.LOCALE` 旗標的編譯正則表達式物件不再依賴編譯時的 locale。" +"只有匹配時的 locale 才會影響匹配結果。" #: ../../library/re.rst:811 +#, fuzzy msgid "" "When specified, the pattern character ``'^'`` matches at the beginning of " "the string and at the beginning of each line (immediately following each " @@ -1147,48 +1188,67 @@ msgid "" "only at the end of the string and immediately before the newline (if any) at " "the end of the string." msgstr "" +"當指定時,樣式字元 ``'^「`` 會在字串的開頭和每一行的開頭(緊接在每個新線之" +"後)匹配;樣式字元 ``」$'`` 會在字串的結尾和每一行的結尾(緊接在每個新線之" +"前)匹配。 預設情況下,``'^「`` 只在字串的開頭匹配,``」$'`` 只在字串的結尾" +"和緊接在字串結尾的換行符(如果有)之前匹配。" #: ../../library/re.rst:818 +#, fuzzy msgid "Corresponds to the inline flag ``(?m)``." -msgstr "" +msgstr "對應內聯旗標 ``(?m)``。" #: ../../library/re.rst:822 +#, fuzzy msgid "" "Indicates no flag being applied, the value is ``0``. This flag may be used " "as a default value for a function keyword argument or as a base value that " "will be conditionally ORed with other flags. Example of use as a default " "value::" msgstr "" +"表示沒有套用旗標,值為 ``0``。 此旗標可用作函式關鍵字參數的預設值,或用作將" +"與其他旗標進行有條件 OR 的基本值。 作為預設值使用的範例::" #: ../../library/re.rst:827 msgid "" "def myfunc(text, flag=re.NOFLAG):\n" " return re.match(text, flag)" msgstr "" +"def myfunc(text, flag=re.NOFLAG):\n" +" return re.match(text, flag)" #: ../../library/re.rst:835 +#, fuzzy msgid "" "Make the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." msgstr "" +"使 ``'.「`` 特殊字元匹配任何字元,包括換行符;如果沒有這個旗標,``」.'` 將匹" +"配除換行符以外的任何字元。" #: ../../library/re.rst:838 +#, fuzzy msgid "Corresponds to the inline flag ``(?s)``." -msgstr "" +msgstr "對應內聯旗標 ``(?s)``。" #: ../../library/re.rst:844 +#, fuzzy msgid "" "In Python 3, Unicode characters are matched by default for ``str`` patterns. " "This flag is therefore redundant with **no effect** and is only kept for " "backward compatibility." msgstr "" +"在 Python 3 中,Unicode 字元預設是匹配 ``str`` 模式。因此,這個旗號是多餘的," +"沒有**作用,保留它只是為了向後相容。" #: ../../library/re.rst:849 +#, fuzzy msgid "" "See :py:const:`~re.ASCII` to restrict matching to ASCII characters instead." -msgstr "" +msgstr "請參閱 :py:const:`~re.ASCII` 來限制匹配為 ASCII 字元。" #: ../../library/re.rst:856 +#, fuzzy msgid "" "This flag allows you to write regular expressions that look nicer and are " "more readable by allowing you to visually separate logical sections of the " @@ -1200,24 +1260,36 @@ msgid "" "characters from the leftmost such ``#`` through the end of the line are " "ignored." msgstr "" +"此旗標允許您視覺上分隔模式的邏輯部分並加入註解,讓您寫出的正則表 達式看起來更" +"美觀、更易讀。除非是在字元類別中、或前面有未括開的反斜線、或在像 ``*?``、" +"``(?:`` 或 ``(?P<...>``這類的符號中,否則模式中的空白會被忽略。例如,``(?:`` " +"和 ``*?``` 是不允許的。當一行包含不屬於某個字元類別的 ``#`` 且前面沒有反斜線" +"時,從最左邊的這個 ``#`` 到該行結尾的所有字元都會被忽略。" #: ../../library/re.rst:866 +#, fuzzy msgid "" "This means that the two following regular expression objects that match a " "decimal number are functionally equal::" -msgstr "" +msgstr "這表示以下兩個匹配十進位數字的正則表達式物件在功能上是相等的::" #: ../../library/re.rst:869 +#, fuzzy msgid "" "a = re.compile(r\"\"\"\\d + # the integral part\n" " \\. # the decimal point\n" " \\d * # some fractional digits\"\"\", re.X)\n" "b = re.compile(r\"\\d+\\.\\d*\")" msgstr "" +"a = re.compile(r\"\"\"\\d + # 整數部分\n" +" \\. # 小數點\n" +" \\d * # 一些小數位\"\"\"\", re.X)\n" +"b = re.compile(r\"\\d+\\.\\d*\")" #: ../../library/re.rst:874 +#, fuzzy msgid "Corresponds to the inline flag ``(?x)``." -msgstr "" +msgstr "對應內聯旗標 ``(?x)``。" #: ../../library/re.rst:878 msgid "Functions" @@ -1658,20 +1730,26 @@ msgid "" msgstr "" #: ../../library/re.rst:1224 +#, fuzzy msgid "Regular Expression Objects" -msgstr "" +msgstr "正規表達物件" #: ../../library/re.rst:1228 +#, fuzzy msgid "Compiled regular expression object returned by :func:`re.compile`." -msgstr "" +msgstr "由 :func:`re.compile` 回傳的已編譯正規表示式物件。" #: ../../library/re.rst:1230 +#, fuzzy msgid "" ":py:class:`re.Pattern` supports ``[]`` to indicate a Unicode (str) or bytes " "pattern. See :ref:`types-genericalias`." msgstr "" +":py:class:`re.Pattern` 支援 ``[]`` 來表示 Unicode (str) 或 bytes 模式。請參" +"閱 :ref:`types-genericalias`。" #: ../../library/re.rst:1236 +#, fuzzy msgid "" "Scan through *string* looking for the first location where this regular " "expression produces a match, and return a corresponding :class:`~re.Match`. " @@ -1679,8 +1757,12 @@ msgid "" "this is different from finding a zero-length match at some point in the " "string." msgstr "" +"掃描 *string* 找尋此正規表示式產生匹配的第一個位置,並回傳相對應的 :class:" +"`~re.Match`。如果字串中沒有任何位置與模式匹配,則回傳 ``None``;請注意,這與" +"在字串中的某一點找到零長度的匹配不同。" #: ../../library/re.rst:1241 +#, fuzzy msgid "" "The optional second parameter *pos* gives an index in the string where the " "search is to start; it defaults to ``0``. This is not completely equivalent " @@ -1688,8 +1770,12 @@ msgid "" "beginning of the string and at positions just after a newline, but not " "necessarily at the index where the search is to start." msgstr "" +"可選的第二個參數 *pos* 給出在字串中要開始搜尋的索引;預設為 ``0``。 這並不完" +"全等同於分割字串;```'^'``模式符會匹配字串真正的開頭和換行符之後的位置,但不" +"一定會匹配搜尋開始的索引。" #: ../../library/re.rst:1247 +#, fuzzy msgid "" "The optional parameter *endpos* limits how far the string will be searched; " "it will be as if the string is *endpos* characters long, so only the " @@ -1698,6 +1784,10 @@ msgid "" "compiled regular expression object, ``rx.search(string, 0, 50)`` is " "equivalent to ``rx.search(string[:50], 0)``. ::" msgstr "" +"可選參數 *endpos* 會限制字串被搜尋的距離;它會像字串的長度是 *endpos* 字元一" +"樣,所以只有從 *pos* 到 ``endpos - 1`` 的字元會被搜尋到匹配。 如果 *endpos* " +"小於 *pos*,則不會找到匹配;否則,如果 *rx* 是編譯過的正規表示式物件,``rx." +"search(string, 0, 50)`` 等同於``rx.search(string[:50], 0)``。 ::" #: ../../library/re.rst:1254 msgid "" @@ -1708,18 +1798,24 @@ msgid "" msgstr "" #: ../../library/re.rst:1262 +#, fuzzy msgid "" "If zero or more characters at the *beginning* of *string* match this regular " "expression, return a corresponding :class:`~re.Match`. Return ``None`` if " "the string does not match the pattern; note that this is different from a " "zero-length match." msgstr "" +"如果在 *string* 的 *beginning* 有 0 個或以上的字元符合這個正規表示式,就會回" +"傳一個相對應的 :class:`~re.Match`。如果字串不符合模式,則回傳 ``None``;請注" +"意,這與長度為零的匹配不同。" #: ../../library/re.rst:1267 ../../library/re.rst:1285 +#, fuzzy msgid "" "The optional *pos* and *endpos* parameters have the same meaning as for the :" "meth:`~Pattern.search` method. ::" msgstr "" +"可選的 *pos* 和 *endpos* 參數與 :meth:`~Pattern.search` 方法的意義相同。 ::" #: ../../library/re.rst:1270 msgid "" @@ -1732,17 +1828,23 @@ msgid "" msgstr "" #: ../../library/re.rst:1275 +#, fuzzy msgid "" "If you want to locate a match anywhere in *string*, use :meth:`~Pattern." "search` instead (see also :ref:`search-vs-match`)." msgstr "" +"如果要在 *string* 的任何地方找出匹配,請使用 :meth:`~Pattern.search` 來代替 " +"(請參閱 :ref:`search-vs-match`)。" #: ../../library/re.rst:1281 +#, fuzzy msgid "" "If the whole *string* matches this regular expression, return a " "corresponding :class:`~re.Match`. Return ``None`` if the string does not " "match the pattern; note that this is different from a zero-length match." msgstr "" +"如果整個 *string* 符合這個正則表達式,回傳相應的 :class:`~re.Match`。 如果字" +"串不符合模式,則回傳 ``None``;請注意,這與零長度匹配不同。" #: ../../library/re.rst:1288 msgid "" @@ -1756,69 +1858,95 @@ msgid "" msgstr "" #: ../../library/re.rst:1299 +#, fuzzy msgid "Identical to the :func:`split` function, using the compiled pattern." -msgstr "" +msgstr "與 :func:`split` 函式相同,使用編譯的模式。" #: ../../library/re.rst:1304 +#, fuzzy msgid "" "Similar to the :func:`findall` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" +"類似於 :func:`findall` 函式,使用編譯的模式,但也接受可選的 *pos* 和 " +"*endpos* 參數,像 :meth:`search` 一樣限制搜尋區域。" #: ../../library/re.rst:1311 +#, fuzzy msgid "" "Similar to the :func:`finditer` function, using the compiled pattern, but " "also accepts optional *pos* and *endpos* parameters that limit the search " "region like for :meth:`search`." msgstr "" +"類似於 :func:`finditer` 函式,使用編譯的樣式,但也接受可選的 *pos* 和 " +"*endpos* 參數,像 :meth:`search` 一樣限制搜尋區域。" #: ../../library/re.rst:1318 +#, fuzzy msgid "Identical to the :func:`sub` function, using the compiled pattern." -msgstr "" +msgstr "與 :func:`sub` 函式相同,使用編譯的模式。" #: ../../library/re.rst:1323 +#, fuzzy msgid "Identical to the :func:`subn` function, using the compiled pattern." -msgstr "" +msgstr "與 :func:`subn` 函式相同,使用編譯的模式。" #: ../../library/re.rst:1328 +#, fuzzy msgid "" "The regex matching flags. This is a combination of the flags given to :func:" "`.compile`, any ``(?...)`` inline flags in the pattern, and implicit flags " "such as :py:const:`~re.UNICODE` if the pattern is a Unicode string." msgstr "" +"regex 匹配标志。 這是給 :func:`.compile` 的旗標、pattern 中任何 ``(?...)`` " +"內嵌旗標,以及隱含旗標的組合,例如 :py:const:`~re.UNICODE` (如果 pattern 是 " +"Unicode 字串)。" #: ../../library/re.rst:1335 +#, fuzzy msgid "The number of capturing groups in the pattern." -msgstr "" +msgstr "圖樣中捕捉群組的數量。" #: ../../library/re.rst:1340 +#, fuzzy msgid "" "A dictionary mapping any symbolic group names defined by ``(?P)`` to " "group numbers. The dictionary is empty if no symbolic groups were used in " "the pattern." msgstr "" +"將 ``(?P)`` 定義的任何符號群組名稱對應到群組號碼的辭典。 如果模式中沒有" +"使用符號群組,字典為空。" #: ../../library/re.rst:1347 +#, fuzzy msgid "The pattern string from which the pattern object was compiled." -msgstr "" +msgstr "編譯模式物件的模式字串。" #: ../../library/re.rst:1350 +#, fuzzy msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Compiled " "regular expression objects are considered atomic." msgstr "" +"新增對 :func:`copy.copy` 和 :func:`copy.deepcopy` 的支援。 編譯的正則表達式" +"物件被視為原子物件。" #: ../../library/re.rst:1358 +#, fuzzy msgid "Match Objects" -msgstr "" +msgstr "匹配物件" #: ../../library/re.rst:1360 +#, fuzzy msgid "" "Match objects always have a boolean value of ``True``. Since :meth:`~Pattern." "match` and :meth:`~Pattern.search` return ``None`` when there is no match, " "you can test whether there was a match with a simple ``if`` statement::" msgstr "" +"Match 物件永遠有一個 ``True`` 的布林值。由於 :meth:`~Pattern.match` 和 :meth:" +"`~Pattern.search` 在沒有匹配時會回傳 ``None``,您可以用簡單的 ``if` 語句來測" +"試是否有匹配::" #: ../../library/re.rst:1365 msgid "" @@ -1831,16 +1959,21 @@ msgstr "" " process(match)" #: ../../library/re.rst:1371 +#, fuzzy msgid "Match object returned by successful ``match``\\ es and ``search``\\ es." -msgstr "" +msgstr "由成功的 ``match``es 和 ``search``es 回傳的匹配物件。" #: ../../library/re.rst:1373 +#, fuzzy msgid "" ":py:class:`re.Match` supports ``[]`` to indicate a Unicode (str) or bytes " "match. See :ref:`types-genericalias`." msgstr "" +":py:class:`re.Match` 支援 ``[]`` 來表示 Unicode (str) 或 bytes 匹配。請參閱 :" +"ref:`types-genericalias`。" #: ../../library/re.rst:1379 +#, fuzzy msgid "" "Return the string obtained by doing backslash substitution on the template " "string *template*, as done by the :meth:`~Pattern.sub` method. Escapes such " @@ -1849,8 +1982,13 @@ msgid "" "``\\g``) are replaced by the contents of the corresponding group. The " "backreference ``\\g<0>`` will be replaced by the entire match." msgstr "" +"根據 :meth:`~Pattern.sub` 方法,回傳在模板字串 *template* 上進行反斜線取代所" +"得到的字串。轉換符如 ``\\n`` 會被轉換成適當的字元、數字反向引用 (``\\1``、" +"``\\2``) 和命名反向引用 (``\\g<1>``、``\\g``) 會被相對應的群組內容取" +"代。反向引用 ``\\g<0>`` 將被整個匹配內容取代。" #: ../../library/re.rst:1392 +#, fuzzy msgid "" "Returns one or more subgroups of the match. If there is a single argument, " "the result is a single string; if there are multiple arguments, the result " @@ -1864,6 +2002,13 @@ msgid "" "the corresponding result is ``None``. If a group is contained in a part of " "the pattern that matched multiple times, the last match is returned. ::" msgstr "" +"回傳匹配的一個或多個子群組。 如果只有一個參數,則結果為單一字串;如果有多個" +"參數,則結果為元組,每個參數有一個項目。在沒有參數的情況下,*group1* 預設為零" +"(會回傳整個匹配結果)。如果 *groupN* 參數為零,對應的回傳值是整個匹配字串;" +"如果它在包含範圍 [1.99],則是匹配對應括弧群組的字串。 如果群組號碼是負數或大" +"於模式中定義的群組數,則會產生 :exc:`IndexError` 例外。如果一個群組包含在模式" +"中沒有匹配到的部分,對應的結果是 ``None``。如果一個群組包含在模式中多次匹配的" +"部分,則回傳最後一次匹配的結果。 ::" #: ../../library/re.rst:1404 msgid "" @@ -1879,16 +2024,21 @@ msgid "" msgstr "" #: ../../library/re.rst:1414 +#, fuzzy msgid "" "If the regular expression uses the ``(?P...)`` syntax, the *groupN* " "arguments may also be strings identifying groups by their group name. If a " "string argument is not used as a group name in the pattern, an :exc:" "`IndexError` exception is raised." msgstr "" +"如果正規表達式使用 ``(?P...)`` 語法,*groupN* 參數也可以是以群組名稱來" +"識別群組的字串。 如果在模式中沒有使用字串參數作為群組名稱,則會產生 :exc:" +"`IndexError` 例外。" #: ../../library/re.rst:1419 +#, fuzzy msgid "A moderately complicated example::" -msgstr "" +msgstr "中度複雜的範例::" #: ../../library/re.rst:1421 msgid "" @@ -1907,8 +2057,9 @@ msgstr "" "'Reynolds'" #: ../../library/re.rst:1427 +#, fuzzy msgid "Named groups can also be referred to by their index::" -msgstr "" +msgstr "已命名群組也可以用其索引:來參照:" #: ../../library/re.rst:1429 msgid "" @@ -1923,8 +2074,9 @@ msgstr "" "'Reynolds'" #: ../../library/re.rst:1434 +#, fuzzy msgid "If a group matches multiple times, only the last match is accessible::" -msgstr "" +msgstr "如果一個群組匹配多次,則只可存取最後一個匹配的群組::" #: ../../library/re.rst:1436 msgid "" @@ -1934,10 +2086,11 @@ msgid "" msgstr "" #: ../../library/re.rst:1443 +#, fuzzy msgid "" "This is identical to ``m.group(g)``. This allows easier access to an " "individual group from a match::" -msgstr "" +msgstr "這與 ``m.group(g)`` 相同。 這允許更容易地從 match: 存取個別群組:" #: ../../library/re.rst:1446 msgid "" @@ -1951,8 +2104,9 @@ msgid "" msgstr "" #: ../../library/re.rst:1454 +#, fuzzy msgid "Named groups are supported as well::" -msgstr "" +msgstr "也支援命名群組::" #: ../../library/re.rst:1456 msgid "" @@ -1971,11 +2125,14 @@ msgstr "" "'Newton'" #: ../../library/re.rst:1467 +#, fuzzy msgid "" "Return a tuple containing all the subgroups of the match, from 1 up to " "however many groups are in the pattern. The *default* argument is used for " "groups that did not participate in the match; it defaults to ``None``." msgstr "" +"回傳一個包含所有匹配的子群組的元組數,從 1 到模式中的多少個群組。 *default* " +"參數用於沒有參與匹配的群組;它的預設值是 ``None``。" #: ../../library/re.rst:1471 ../../library/re.rst:1696 msgid "For example::" @@ -1992,11 +2149,14 @@ msgstr "" "('24', '1632')" #: ../../library/re.rst:1477 +#, fuzzy msgid "" "If we make the decimal place and everything after it optional, not all " "groups might participate in the match. These groups will default to " "``None`` unless the *default* argument is given::" msgstr "" +"如果我們將小數位及之後的所有內容設定為可選,並非所有的群組都可能參與匹配。 " +"除非給出 *default* 參數,否則這些群組將預設為 ``None``::" #: ../../library/re.rst:1481 msgid "" @@ -2008,11 +2168,14 @@ msgid "" msgstr "" #: ../../library/re.rst:1490 +#, fuzzy msgid "" "Return a dictionary containing all the *named* subgroups of the match, keyed " "by the subgroup name. The *default* argument is used for groups that did " "not participate in the match; it defaults to ``None``. For example::" msgstr "" +"回傳一個字典,包含所有匹配的 *named* 子群組,以子群組名稱為關鍵。 *default* " +"參數用於沒有參與匹配的群組;預設為 ``None``。 例如::" #: ../../library/re.rst:1494 msgid "" @@ -2027,6 +2190,7 @@ msgstr "" "{'first_name': 'Malcolm', 'last_name': 'Reynolds'}" #: ../../library/re.rst:1502 +#, fuzzy msgid "" "Return the indices of the start and end of the substring matched by *group*; " "*group* defaults to zero (meaning the whole matched substring). Return " @@ -2034,22 +2198,32 @@ msgid "" "object *m*, and a group *g* that did contribute to the match, the substring " "matched by group *g* (equivalent to ``m.group(g)``) is ::" msgstr "" +"回傳 *group* 所匹配子串的開始和結束的索引;*group* 預設為零(意指整個匹配的子" +"串)。如果 *group* 存在,但沒有參與匹配,則回傳 ``-1``。 對於一個匹配物件 " +"*m*,以及一個對匹配有貢獻的群組 *g*,群組 *g* 所匹配的子串 (等於 ``m." +"group(g)``) 是 ::" #: ../../library/re.rst:1508 msgid "m.string[m.start(g):m.end(g)]" msgstr "m.string[m.start(g):m.end(g)]" #: ../../library/re.rst:1510 +#, fuzzy msgid "" "Note that ``m.start(group)`` will equal ``m.end(group)`` if *group* matched " "a null string. For example, after ``m = re.search('b(c?)', 'cba')``, ``m." "start(0)`` is 1, ``m.end(0)`` is 2, ``m.start(1)`` and ``m.end(1)`` are both " "2, and ``m.start(2)`` raises an :exc:`IndexError` exception." msgstr "" +"請注意,如果 *group* 匹配的是空字串,``m.start(group)`` 將等於``m." +"end(group)``。 例如,在 ``m = re.search('b(c?)', 'cba')`` 之後, ``m." +"start(0)`` 是 1,``m.end(0)`` 是 2,``m.start(1)`` 和 ``m.end(1)`` 都是 2," +"``m.start(2)`` 產生 :exc:`IndexError` 例外。" #: ../../library/re.rst:1515 +#, fuzzy msgid "An example that will remove *remove_this* from email addresses::" -msgstr "" +msgstr "將從電子郵件地址移除 *remove_this* 的範例::" #: ../../library/re.rst:1517 msgid "" @@ -2064,27 +2238,38 @@ msgstr "" "'tony@tiger.net'" #: ../../library/re.rst:1525 +#, fuzzy msgid "" "For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note " "that if *group* did not contribute to the match, this is ``(-1, -1)``. " "*group* defaults to zero, the entire match." msgstr "" +"對於一個匹配 *m*,回傳 2-tuple ``(m.start(group),m.end(group))``。請注意,如" +"果 *group* 對匹配沒有貢獻,這將是 ``(-1, -1)`` 。*group* 預設為零,即整個匹" +"配。" #: ../../library/re.rst:1532 +#, fuzzy msgid "" "The value of *pos* which was passed to the :meth:`~Pattern.search` or :meth:" "`~Pattern.match` method of a :ref:`regex object `. This is the " "index into the string at which the RE engine started looking for a match." msgstr "" +"傳給 :ref:`regex object ` 的 :meth:`~Pattern.search` 或 :meth:" +"`~Pattern.match` 方法的 *pos* 值。 這是 RE 引擎開始尋找匹配的字串索引。" #: ../../library/re.rst:1539 +#, fuzzy msgid "" "The value of *endpos* which was passed to the :meth:`~Pattern.search` or :" "meth:`~Pattern.match` method of a :ref:`regex object `. This is " "the index into the string beyond which the RE engine will not go." msgstr "" +"傳給 :ref:`regex object ` 的 :meth:`~Pattern.search` 或 :meth:" +"`~Pattern.match` 方法的 *endpos* 值。 這是 RE 引擎不會超越的字串索引。" #: ../../library/re.rst:1546 +#, fuzzy msgid "" "The integer index of the last matched capturing group, or ``None`` if no " "group was matched at all. For example, the expressions ``(a)b``, ``((a)" @@ -2092,42 +2277,58 @@ msgid "" "``'ab'``, while the expression ``(a)(b)`` will have ``lastindex == 2``, if " "applied to the same string." msgstr "" +"最後配對的捕捉群組的整數索引,或 ``None`` 如果沒有任何群組被配對。例如,表達" +"式 ``(a)b``、``((a)(b))` 和 ``((ab))`如果套用在字串 `'ab'` 上,將有 " +"``lastindex == 1``,而表達式 ``(a)(b)`如果套用在相同的字串上,將有 " +"``lastindex == 2``。" #: ../../library/re.rst:1555 +#, fuzzy msgid "" "The name of the last matched capturing group, or ``None`` if the group " "didn't have a name, or if no group was matched at all." msgstr "" +"最後配對的擷取群組名稱,如果群組沒有名稱,或根本沒有配對群組,則為 ``None``。" #: ../../library/re.rst:1561 +#, fuzzy msgid "" "The :ref:`regular expression object ` whose :meth:`~Pattern." "match` or :meth:`~Pattern.search` method produced this match instance." msgstr "" +":ref:`regular expression object `,其 :meth:`~Pattern.match` 或 :" +"meth:`~Pattern.search` 方法產生這個 match 實例。" #: ../../library/re.rst:1567 +#, fuzzy msgid "The string passed to :meth:`~Pattern.match` or :meth:`~Pattern.search`." -msgstr "" +msgstr "傳給 :meth:`~Pattern.match` 或 :meth:`~Pattern.search` 的字串。" #: ../../library/re.rst:1570 +#, fuzzy msgid "" "Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects " "are considered atomic." msgstr "" +"新增了 :func:`copy.copy` 和 :func:`copy.deepcopy` 的支援。 匹配物件被視為原" +"子物件。" #: ../../library/re.rst:1578 +#, fuzzy msgid "Regular Expression Examples" -msgstr "" +msgstr "正規表示法範例" #: ../../library/re.rst:1582 +#, fuzzy msgid "Checking for a Pair" -msgstr "" +msgstr "檢查對子" #: ../../library/re.rst:1584 +#, fuzzy msgid "" "In this example, we'll use the following helper function to display match " "objects a little more gracefully::" -msgstr "" +msgstr "在本範例中,我們將使用下列輔助函式,以更優雅的方式顯示匹配物件::" #: ../../library/re.rst:1587 msgid "" @@ -2150,8 +2351,9 @@ msgid "" msgstr "" #: ../../library/re.rst:1597 +#, fuzzy msgid "To see if a given string is a valid hand, one could do the following::" -msgstr "" +msgstr "要查看給定的字串是否是有效的手,可以執行下列操作::" #: ../../library/re.rst:1599 msgid "" @@ -2165,11 +2367,14 @@ msgid "" msgstr "" #: ../../library/re.rst:1607 +#, fuzzy msgid "" "That last hand, ``\"727ak\"``, contained a pair, or two of the same valued " "cards. To match this with a regular expression, one could use backreferences " "as such::" msgstr "" +"最後一手牌,``\"727ak\"``,包含一對或兩張相同價值的牌。若要使用正規表達式來匹" +"配,可以使用反向參照,例如::" #: ../../library/re.rst:1610 msgid "" @@ -2182,10 +2387,13 @@ msgid "" msgstr "" #: ../../library/re.rst:1617 +#, fuzzy msgid "" "To find out what card the pair consists of, one could use the :meth:`~Match." "group` method of the match object in the following manner::" msgstr "" +"若要找出這對牌由哪張牌組成,可以使用 match 物件的 :meth:`~Match.group` 方法," +"方式如下::" #: ../../library/re.rst:1620 msgid "" @@ -2210,6 +2418,7 @@ msgid "Simulating scanf()" msgstr "模擬 scanf()" #: ../../library/re.rst:1640 +#, fuzzy msgid "" "Python does not currently have an equivalent to :c:func:`!scanf`. Regular " "expressions are generally more powerful, though also more verbose, than :c:" @@ -2217,14 +2426,19 @@ msgid "" "equivalent mappings between :c:func:`!scanf` format tokens and regular " "expressions." msgstr "" +"Python 目前沒有與 :c:func:`!scanf` 對等的東西。 正则表达式通常比 :c:func:`!" +"scanf` 格式字串更强大,尽管也更啰嗦。 下表提供了 :c:func:`!scanf` 格式符號和" +"正則表達式之間的一些或多或少等效的映射。" #: ../../library/re.rst:1647 +#, fuzzy msgid ":c:func:`!scanf` Token" -msgstr "" +msgstr ":c:func:`!scanf` 令牌" #: ../../library/re.rst:1647 +#, fuzzy msgid "Regular Expression" -msgstr "" +msgstr "正規表示法" #: ../../library/re.rst:1649 msgid "``%c``" @@ -2295,51 +2509,60 @@ msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``" msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``" #: ../../library/re.rst:1668 +#, fuzzy msgid "To extract the filename and numbers from a string like ::" -msgstr "" +msgstr "要從字串中抽取檔案名稱和數字,如::" #: ../../library/re.rst:1670 msgid "/usr/sbin/sendmail - 0 errors, 4 warnings" msgstr "/usr/sbin/sendmail - 0 errors, 4 warnings" #: ../../library/re.rst:1672 +#, fuzzy msgid "you would use a :c:func:`!scanf` format like ::" -msgstr "" +msgstr "您可以使用 :c:func:`!scanf` 格式,如 ::" #: ../../library/re.rst:1674 +#, fuzzy msgid "%s - %d errors, %d warnings" -msgstr "" +msgstr "%s - %d 錯誤,%d 警告" #: ../../library/re.rst:1676 +#, fuzzy msgid "The equivalent regular expression would be ::" -msgstr "" +msgstr "等效的正則表達式為 ::" #: ../../library/re.rst:1678 +#, fuzzy msgid "(\\S+) - (\\d+) errors, (\\d+) warnings" -msgstr "" +msgstr "(\\S+) - (\\d+) 錯誤, (\\d+) 警告" #: ../../library/re.rst:1684 msgid "search() vs. match()" msgstr "search() vs. match()" #: ../../library/re.rst:1688 +#, fuzzy msgid "" "Python offers different primitive operations based on regular expressions:" -msgstr "" +msgstr "Python 提供了基於正則表達式的不同原始運算:" #: ../../library/re.rst:1690 +#, fuzzy msgid ":func:`re.match` checks for a match only at the beginning of the string" -msgstr "" +msgstr ":func:`re.match` 僅檢查字串開頭是否匹配" #: ../../library/re.rst:1691 +#, fuzzy msgid "" ":func:`re.search` checks for a match anywhere in the string (this is what " "Perl does by default)" -msgstr "" +msgstr ":func:`re.search` 檢查字串中任何地方是否有匹配 (Perl 預設會這樣做)" #: ../../library/re.rst:1693 +#, fuzzy msgid ":func:`re.fullmatch` checks for entire string to be a match" -msgstr "" +msgstr ":func:`re.fullmatch` 檢查整個字串是否匹配" #: ../../library/re.rst:1698 msgid "" @@ -2352,10 +2575,13 @@ msgid "" msgstr "" #: ../../library/re.rst:1705 +#, fuzzy msgid "" "Regular expressions beginning with ``'^'`` can be used with :func:`search` " "to restrict the match at the beginning of the string::" msgstr "" +"以 ``'^'`` 開頭的正則表達式可與 :func:`search` 搭配使用,以限制字串開頭的匹" +"配::" #: ../../library/re.rst:1708 msgid "" @@ -2366,12 +2592,16 @@ msgid "" msgstr "" #: ../../library/re.rst:1713 +#, fuzzy msgid "" "Note however that in :const:`MULTILINE` mode :func:`match` only matches at " "the beginning of the string, whereas using :func:`search` with a regular " "expression beginning with ``'^'`` will match at the beginning of each " "line. ::" msgstr "" +"但是請注意,在 :const:`MULTILINE` 模式中 :func:`match` 只會在字串的開頭進行匹" +"配,而使用 :func:`search` 和以 ``'^'`` 開頭的正則表達式則會在每一行的開頭進行" +"匹配。 ::" #: ../../library/re.rst:1717 msgid "" @@ -2381,22 +2611,28 @@ msgid "" msgstr "" #: ../../library/re.rst:1723 +#, fuzzy msgid "Making a Phonebook" -msgstr "" +msgstr "製作電話簿" #: ../../library/re.rst:1725 +#, fuzzy msgid "" ":func:`split` splits a string into a list delimited by the passed pattern. " "The method is invaluable for converting textual data into data structures " "that can be easily read and modified by Python as demonstrated in the " "following example that creates a phonebook." msgstr "" +":func:`split` 將一個字串分割成一個以傳入的模式為分界的列表。 這個方法對於將" +"文字資料轉換成 Python 可以輕鬆讀取和修改的資料結構非常有價值,就像以下建立電" +"話簿的範例所展示的一樣。" #: ../../library/re.rst:1730 +#, fuzzy msgid "" "First, here is the input. Normally it may come from a file, here we are " "using triple-quoted string syntax" -msgstr "" +msgstr "首先,這裡是輸入。 通常它可能來自檔案,這裡我們使用三引號字串語法" #: ../../library/re.rst:1733 msgid "" @@ -2417,10 +2653,13 @@ msgstr "" "... Heather Albrecht: 548.326.4584 919 Park Place\"\"\"" #: ../../library/re.rst:1743 +#, fuzzy msgid "" "The entries are separated by one or more newlines. Now we convert the string " "into a list with each nonempty line having its own entry:" msgstr "" +"項目之間以一個或多個換行分隔。現在我們將字串轉換成列表,每一行非空的行都有自" +"己的項目:" #: ../../library/re.rst:1746 msgid "" @@ -2439,11 +2678,14 @@ msgstr "" "'Heather Albrecht: 548.326.4584 919 Park Place']" #: ../../library/re.rst:1756 +#, fuzzy msgid "" "Finally, split each entry into a list with first name, last name, telephone " "number, and address. We use the ``maxsplit`` parameter of :func:`split` " "because the address has spaces, our splitting pattern, in it:" msgstr "" +"最後,將每個項目分割為包含名、姓、電話號碼和地址的清單。 我們使用 :func:" +"`split` 的 ``maxsplit`` 參數,因為地址中有空格,也就是我們的分割模式:" #: ../../library/re.rst:1760 msgid "" @@ -2460,11 +2702,14 @@ msgstr "" "['Heather', 'Albrecht', '548.326.4584', '919 Park Place']]" #: ../../library/re.rst:1769 +#, fuzzy msgid "" "The ``:?`` pattern matches the colon after the last name, so that it does " "not occur in the result list. With a ``maxsplit`` of ``4``, we could " "separate the house number from the street name:" msgstr "" +"``:?``模式會匹配姓氏後面的冒號,因此它不會出現在結果清單中。 使用 " +"``maxsplit`` ``4```,我們可以將門牌號碼和街道名稱分開:" #: ../../library/re.rst:1773 msgid "" @@ -2481,16 +2726,21 @@ msgstr "" "['Heather', 'Albrecht', '548.326.4584', '919', 'Park Place']]" #: ../../library/re.rst:1784 +#, fuzzy msgid "Text Munging" -msgstr "" +msgstr "文字萌芽" #: ../../library/re.rst:1786 +#, fuzzy msgid "" ":func:`sub` replaces every occurrence of a pattern with a string or the " "result of a function. This example demonstrates using :func:`sub` with a " "function to \"munge\" text, or randomize the order of all the characters in " "each word of a sentence except for the first and last characters::" msgstr "" +":func:`sub` 用一個字串或一個函式的結果取代每一次出現的 pattern。 這個範例示" +"範使用 :func:`sub` 與函式來 \"munge \"文字,或隨機排列句子中每個字元的順序," +"除了第一個和最後一個字元::" #: ../../library/re.rst:1791 msgid "" @@ -2517,16 +2767,21 @@ msgstr "" "'Pofsroser Aodlambelk, plasee reoprt yuor asnebces potlmrpy.'" #: ../../library/re.rst:1804 +#, fuzzy msgid "Finding all Adverbs" -msgstr "" +msgstr "尋找所有副詞" #: ../../library/re.rst:1806 +#, fuzzy msgid "" ":func:`findall` matches *all* occurrences of a pattern, not just the first " "one as :func:`search` does. For example, if a writer wanted to find all of " "the adverbs in some text, they might use :func:`findall` in the following " "manner::" msgstr "" +":func:`findall` 會匹配模式的所有*次出現,而不是像 :func:`search` 般只匹配第一" +"次出現。 舉例來說,如果作者想要找出某些文字中所有的副詞,他們可能會以下列方" +"式使用 :func:`findall`::" #: ../../library/re.rst:1811 msgid "" @@ -2539,10 +2794,12 @@ msgstr "" "['carefully', 'quickly']" #: ../../library/re.rst:1817 +#, fuzzy msgid "Finding all Adverbs and their Positions" -msgstr "" +msgstr "尋找所有副詞及其位置" #: ../../library/re.rst:1819 +#, fuzzy msgid "" "If one wants more information about all matches of a pattern than the " "matched text, :func:`finditer` is useful as it provides :class:`~re.Match` " @@ -2550,6 +2807,9 @@ msgid "" "writer wanted to find all of the adverbs *and their positions* in some text, " "they would use :func:`finditer` in the following manner::" msgstr "" +"如果您想要比匹配的文字更多的資料, :func:`finditer` 是有用的,因為它提供 :" +"class:`~re.Match` 物件來取代字串。 繼續前面的範例,如果作者想要找出某些文字" +"中所有的副詞 * 及其位置 *,他們會以下列方式使用 :func:`finditer`::" #: ../../library/re.rst:1825 msgid "" @@ -2566,8 +2826,9 @@ msgstr "" "40-47: quickly" #: ../../library/re.rst:1833 +#, fuzzy msgid "Raw String Notation" -msgstr "" +msgstr "原始字串符號" #: ../../library/re.rst:1835 msgid "" @@ -2590,12 +2851,16 @@ msgstr "" "" #: ../../library/re.rst:1845 +#, fuzzy msgid "" "When one wants to match a literal backslash, it must be escaped in the " "regular expression. With raw string notation, this means ``r\"\\\\\"``. " "Without raw string notation, one must use ``\"\\\\\\\\\"``, making the " "following lines of code functionally identical::" msgstr "" +"當要匹配字面上的反斜線時,必須在正規表示式中轉義它。 如果使用原始字串符號," +"這表示 ``r\"\\\\\"``。 如果不使用原始字串符號,則必須使用 ``\"\\\\\\\\\"``," +"這使得以下幾行程式碼在功能上完全相同::" #: ../../library/re.rst:1850 msgid "" @@ -2610,24 +2875,33 @@ msgstr "" "" #: ../../library/re.rst:1857 +#, fuzzy msgid "Writing a Tokenizer" -msgstr "" +msgstr "編寫標記器" #: ../../library/re.rst:1859 +#, fuzzy msgid "" "A `tokenizer or scanner `_ " "analyzes a string to categorize groups of characters. This is a useful " "first step in writing a compiler or interpreter." msgstr "" +"一個 `tokenizer 或 scanner `_ 會分析字串以將字元群分類。 這是撰寫編譯器或直譯器的第一" +"步。" #: ../../library/re.rst:1863 +#, fuzzy msgid "" "The text categories are specified with regular expressions. The technique " "is to combine those into a single master regular expression and to loop over " "successive matches::" msgstr "" +"使用正規表達式指定文字類別。 其技術是將這些內容合併為單一的主正則表達式,並" +"循環檢查連續匹配的內容::" #: ../../library/re.rst:1867 +#, fuzzy msgid "" "from typing import NamedTuple\n" "import re\n" @@ -2682,10 +2956,63 @@ msgid "" "for token in tokenize(statements):\n" " print(token)" msgstr "" +"從 typing 匯入 NamedTuple\n" +"匯入 re\n" +"\n" +"class Token(NamedTuple):\n" +" type: str\n" +" value: str\n" +" line: int\n" +" column: int\n" +"\n" +"def tokenize(code):\n" +" keywords = {'IF', 'THEN', 'ENDIF', 'FOR', 'NEXT', 'GOSUB', 'RETURN'}\n" +" token_specification = [\n" +" ('NUMBER', r'\\d+(\\.\\d*)?'), # 整數或十進位數字\n" +" ('ASSIGN', r':='), # 指定運算符號\n" +" ('END', r';'), # 語句終止符\n" +" ('ID', r'[A-Za-z]+'), # 識別符號\n" +" ('OP', r'[+\\-*/]'), # 算術運算符號\n" +" ('NEWLINE',r'\\n'),#行結束符\n" +" ('SKIP', r'[ \\t]+'), # 跳過空格和制表符\n" +" ('MISMATCH', r'.'), # 任何其他字元\n" +" ]\n" +" tok_regex = '|'.join('(?P<%s>%s)' % pair for pair in " +"token_specification)\n" +" 行數 = 1\n" +" line_start = 0\n" +" for mo in re.finditer(tok_regex, code):\n" +" kind = mo.lastgroup\n" +" value = mo.group()\n" +" column = mo.start() - line_start\n" +" if kind == 'NUMBER':\n" +" value = float(value) if '.' in value else int(value)\n" +" elif kind == 'ID' 且 value 在關鍵字中:\n" +" kind = value\n" +" elif kind == 'NEWLINE':\n" +" line_start = mo.end()\n" +" line_num += 1\n" +" 繼續\n" +" elif kind == 'SKIP':\n" +" 繼續\n" +" elif kind == 'MISMATCH':\n" +" raise RuntimeError(f'{value!r} unexpected on line {line_num}')\n" +" yield Token(kind, value, line_num, column)\n" +"\n" +"statements = '''\n" +" IF quantity THEN\n" +" total := total + price * quantity;\n" +" tax := price * 0.05;\n" +" ENDIF;\n" +"'''\n" +"\n" +"for token in tokenize(statements):\n" +" print(token)" #: ../../library/re.rst:1919 +#, fuzzy msgid "The tokenizer produces the following output::" -msgstr "" +msgstr "tokenizer 產生以下輸出::" #: ../../library/re.rst:1921 msgid "" @@ -2730,12 +3057,16 @@ msgstr "" "Token(type='END', value=';', line=5, column=9)" #: ../../library/re.rst:1942 +#, fuzzy msgid "" "Friedl, Jeffrey. Mastering Regular Expressions. 3rd ed., O'Reilly Media, " "2009. The third edition of the book no longer covers Python at all, but the " "first edition covered writing good regular expression patterns in great " "detail." msgstr "" +"Friedl, Jeffrey.Mastering Regular Expressions.第 3 版,O'Reilly Media,2009 " +"年。這本書的第三版完全不再涵蓋 Python,但第一版非常詳盡地介紹了如何寫出好的正" +"則表達式模式。" #: ../../library/re.rst:99 msgid ". (dot)"