33# This file is distributed under the same license as the Python package.
44#
55# Translators:
6+ # Leo Wang <ascodeasice@gmail.com>, 2023
67msgid ""
78msgstr ""
89"Project-Id-Version :Python 3.12\n "
@@ -32,6 +33,7 @@ msgid ""
3233"This module provides regular expression matching operations similar to those "
3334"found in Perl."
3435msgstr ""
36+ "此模組提供類似於 Perl 中正規表示式的配對操作。"
3537
3638#: ../../library/re.rst:17
3739msgid ""
@@ -42,6 +44,10 @@ msgid ""
4244"substitution, the replacement string must be of the same type as both the "
4345"pattern and the search string."
4446msgstr ""
47+ "被搜尋的模式 (pattern) 與字串可以是 Unicode 字串 (:class:`str`),也可以是 8-bit "
48+ "字串 (:class:`bytes`)。然而,Unicode 字串和 8-bit 字串不能混用:也就是,你不能用 "
49+ "byte 模式配對 Unicode 字串,反之亦然;同樣地,替換時,用來替換的字串必須與模式和搜尋"
50+ "字串是相同的型別 (type)。"
4551
4652#: ../../library/re.rst:24
4753msgid ""
@@ -57,6 +63,13 @@ msgid ""
5763"future this will become a :exc:`SyntaxError`. This behaviour will happen "
5864"even if it is a valid escape sequence for a regular expression."
5965msgstr ""
66+ "正規表示式使用反斜線字元 (``'\\ '``) 表示特別的形式,或是使用特殊字元而不調用"
67+ "它們的特殊意義。這與 Python 在字串文本 (literal) 中,為了一樣的目的使用同一個字元的"
68+ "目的相衝突;舉例來說,為了配對一個反斜線文字,一個人可能需要寫 ``'\\\\\\\\ '`` 當作"
69+ "模式字串,因為正規表示式必須是 ``\\\\ ``,而且每個反斜線在一個普通的 Python 字串文本中"
70+ "必須表示為 ``\\\\ ``。另外,請注意在 Python 的字串文本中使用反斜線的任何無效跳脫序列"
71+ "目前會產生一個 :exc:`SyntaxWarning`,而在未來這會變成一個 :exc:`SyntaxError`。"
72+ "儘管它對正規表示式是一個有效的跳脫序列,這種行為也會發生。"
6073
6174#: ../../library/re.rst:36
6275msgid ""
@@ -67,6 +80,10 @@ msgid ""
6780"a newline. Usually patterns will be expressed in Python code using this raw "
6881"string notation."
6982msgstr ""
83+ "解決方法是對正規表示式模式使用 Python 的原始字串符號;反斜線在一個以 ``'r'`` 為前綴"
84+ "的字串文本中不會被用任何特別的方式處理。所以 ``r\"\\ n\" `` 是一個兩個字元的字串,包含"
85+ " ``'\\ '`` 和 ``'n'``,同時 ``\"\\ n\" `` 是一個單個字元的字串,包含一個換行符號。通常"
86+ "模式在 Python 程式中會使用這個原始字串符號表示。"
7087
7188#: ../../library/re.rst:43
7289msgid ""
@@ -75,13 +92,18 @@ msgid ""
7592"expressions <re-objects>`. The functions are shortcuts that don't require "
7693"you to compile a regex object first, but miss some fine-tuning parameters."
7794msgstr ""
95+ "請務必注意到大部分的正規表示式操作是可以在模組層級的函式和 :ref:`"
96+ "compiled regular expressions <re-objects>` 中的方法使用的。這些函式是個捷徑"
97+ "且讓你不需要先編譯一個正規表示式物件,但是會缺少一些微調參數。"
7898
7999#: ../../library/re.rst:51
80100msgid ""
81101"The third-party `regex <https://pypi.org/project/regex/>`_ module, which has "
82102"an API compatible with the standard library :mod:`re` module, but offers "
83103"additional functionality and a more thorough Unicode support."
84104msgstr ""
105+ "第三方的 `regex <https://pypi.org/project/regex/>`_ 模組,有著和標準函式庫"
106+ " :mod:`re` 模組相容的 API,但是提供額外的功能以及更完整的 Unicode 支援。"
85107
86108#: ../../library/re.rst:59
87109msgid "Regular Expression Syntax"