/locale/ja/LC_MESSAGES/library/re.po
Portable Object | 1874 lines | 1619 code | 255 blank | 0 comment | 0 complexity | 298af258742bd80ad6368eed9eea2500 MD5 | raw file
- # SOME DESCRIPTIVE TITLE.
- # Copyright (C) 1990-2013, Python Software Foundation
- # This file is distributed under the same license as the Python package.
- #
- # Translators:
- # Naoki INADA <songofacandy@gmail.com>, 2013
- # Masato HASHIMOTO <cabezon.hashimoto@gmail.com>, 2012
- # Nozomu Kaneko <nozom.kaneko@gmail.com>, 2012
- msgid ""
- msgstr ""
- "Project-Id-Version: (Deprecated)Python Document Japanese\n"
- "Report-Msgid-Bugs-To: \n"
- "POT-Creation-Date: 2013-12-30 03:15+0900\n"
- "PO-Revision-Date: 2013-12-29 18:37+0000\n"
- "Last-Translator: Naoki INADA <songofacandy@gmail.com>\n"
- "Language-Team: Japanese (http://www.transifex.com/projects/p/python-doc-ja/language/ja/)\n"
- "MIME-Version: 1.0\n"
- "Content-Type: text/plain; charset=UTF-8\n"
- "Content-Transfer-Encoding: 8bit\n"
- "Language: ja\n"
- "Plural-Forms: nplurals=1; plural=0;\n"
- # d8b4772fe4ae4e59afde551d31304908
- #: ../../library/re.rst:2
- msgid ":mod:`re` --- Regular expression operations"
- msgstr ":mod:`re` --- 正規表現操作"
- # e4cd8346f4fa46529d50a20dc603c614
- #: ../../library/re.rst:10
- msgid ""
- "This module provides regular expression matching operations similar to those"
- " found in Perl."
- msgstr "このモジュールでは、Perl などと同様の正規表現マッチング操作を提供しています。"
- # a59b3338fd2a4f6e9023c146e6b86d47
- #: ../../library/re.rst:13
- msgid ""
- "Both patterns and strings to be searched can be Unicode strings as well as "
- "8-bit strings. However, Unicode strings and 8-bit strings cannot be mixed: "
- "that is, you cannot match an Unicode string with a byte pattern or vice-"
- "versa; similarly, when asking for a substitution, the replacement string "
- "must be of the same type as both the pattern and the search string."
- msgstr "パターンと文字列には Unicode 文字列および 8 ビット文字列が使用できます。しかし、Unicode 文字列と8ビット文字列の混在はできません。すなわち、Unicode 文字列をバイト列のパターンでマッチングや、その逆はできません。同様に、置き換え時の置換文字列はパターンおよび検索文字列と同じ型でなくてはなりません。"
- # c4edfbaf1d4643bc88552fc112ad5be7
- #: ../../library/re.rst:19
- msgid ""
- "Regular expressions use the backslash character (``'\\'``) to indicate "
- "special forms or to allow special characters to be used without invoking "
- "their special meaning. This collides with Python's usage of the same "
- "character for the same purpose in string literals; for example, to match a "
- "literal backslash, one might have to write ``'\\\\\\\\'`` as the pattern "
- "string, because the regular expression must be ``\\\\``, and each backslash "
- "must be expressed as ``\\\\`` inside a regular Python string literal."
- msgstr "正規表現では、特殊な形式を表したり、特殊文字の持つ特別な意味を呼び出さずにその特殊な文字を使えるようにするために、バックスラッシュ文字 (``'\\'``) を使います。こうしたバックスラッシュの使い方は、Python の文字列リテラルにおける同じバックスラッシュ文字と衝突を起こします。例えば、バックスラッシュ自体にマッチさせるには、パターン文字列として ``'\\\\\\\\'`` と書かなければなりません、というのも、正規表現は ``\\\\`` でなければならず、さらに正規な Python 文字列リテラルでは各々のバックスラッシュを ``\\\\`` と表現しなければならないからです。"
- # fad5cf7d641f4f60af640bbd67ca50bf
- #: ../../library/re.rst:28
- msgid ""
- "The solution is to use Python's raw string notation for regular expression "
- "patterns; backslashes are not handled in any special way in a string literal"
- " prefixed with ``'r'``. So ``r\"\\n\"`` is a two-character string "
- "containing ``'\\'`` and ``'n'``, while ``\"\\n\"`` is a one-character string"
- " containing a newline. Usually patterns will be expressed in Python code "
- "using this raw string notation."
- msgstr "正規表現パターンに Python の raw 文字列記法を使えばこの問題を解決できます。``'r'`` を前に付けた文字列リテラル内ではバックスラッシュを特別扱いしません。従って、``\"\\n\"`` が改行一文字の入った文字列になるのに対して、``r\"\\n\"`` は ``'\\'`` と ``'n'`` という二つの文字の入った文字列になります。通常、Python コード中では、パターンをこの文字列記法を使って表現します。"
- # 99e1dce256c1449791680ba69ce67ae4
- #: ../../library/re.rst:35
- msgid ""
- "It is important to note that most regular expression operations are "
- "available as module-level functions and methods on :ref:`compiled regular "
- "expressions <re-objects>`. The functions are shortcuts that don't require "
- "you to compile a regex object first, but miss some fine-tuning parameters."
- msgstr "大抵の正規表現操作が、モジュールレベルの関数と、 :ref:`コンパイル済み正規表現 <re-objects>` のメソッドとして提供されることに注意して下さい。関数は正規表現オブジェクトのコンパイルを必要としない近道ですが、いくつかのチューニング変数を失います。"
- # 5f7940a676084b558c8baeaba0c9bcf5
- #: ../../library/re.rst:45
- msgid "Mastering Regular Expressions"
- msgstr "Mastering Regular Expressions (邦題『詳説 正規表現』)"
- # 00769c7daa294964b581be69508dd616
- #: ../../library/re.rst:44
- msgid ""
- "Book on regular expressions by Jeffrey Friedl, published by O'Reilly. The "
- "second edition of the book no longer covers Python at all, but the first "
- "edition covered writing good regular expression patterns in great detail."
- msgstr "Jeffrey Friedl 著、O'Reilly 刊の正規表現に関する書籍です。この本の第2版では Pyhon については触れていませんが、良い正規表現パターンの書き方を非常に詳しく説明しています。"
- # dbf06a20658b43158c8cefb14a917b19
- #: ../../library/re.rst:52
- msgid "Regular Expression Syntax"
- msgstr "正規表現の構文"
- # 61ae6ae871fe4e05a8b2faadb1ab413f
- #: ../../library/re.rst:54
- msgid ""
- "A regular expression (or RE) specifies a set of strings that matches it; the"
- " functions in this module let you check if a particular string matches a "
- "given regular expression (or if a given regular expression matches a "
- "particular string, which comes down to the same thing)."
- msgstr "正規表現 (RE) は、表現にマッチする文字列の集合を表しています。このモジュールの関数を使えば、ある文字列が指定の正規表現にマッチするか (または指定の正規表現がある文字列にマッチするか、つまりは同じことですが) を検査できます。"
- # 8c663ff834604490b8b0722b6c8dcf9a
- #: ../../library/re.rst:59
- msgid ""
- "Regular expressions can be concatenated to form new regular expressions; if "
- "*A* and *B* are both regular expressions, then *AB* is also a regular "
- "expression. In general, if a string *p* matches *A* and another string *q* "
- "matches *B*, the string *pq* will match AB. This holds unless *A* or *B* "
- "contain low precedence operations; boundary conditions between *A* and *B*; "
- "or have numbered group references. Thus, complex expressions can easily be "
- "constructed from simpler primitive expressions like the ones described here."
- " For details of the theory and implementation of regular expressions, "
- "consult the Friedl book referenced above, or almost any textbook about "
- "compiler construction."
- msgstr "正規表現を連結すると新しい正規表現を作れます。*A* と *B* がともに正規表現であれば *AB* も正規表現です。一般的に、文字列 *p* が *A* とマッチし、別の文字列 *q* が *B* とマッチすれば、文字列 *pq* は AB にマッチします。ただし、この状況が成り立つのは、*A* と *B* との間に境界条件がある場合や、番号付けされたグループ参照のような、優先度の低い演算を *A* や *B* が含まない場合だけです。このようにして、ここで述べるような、より簡単でプリミティブな正規表現から、複雑な正規表現を容易に構築できます。正規表現に関する理論と実装の詳細については上記の Friedl 本か、コンパイラの構築に関するテキストを参照してください。"
- # 118f06bbc0154f0690e5bcc0ab73e6ab
- #: ../../library/re.rst:69
- msgid ""
- "A brief explanation of the format of regular expressions follows. For "
- "further information and a gentler presentation, consult the :ref:`regex-"
- "howto`."
- msgstr "以下で正規表現の形式に関する簡単な説明をします。より詳細な情報やよりやさしい説明に関しては、:ref:`regex-howto` を参照下さい。"
- # e26637a5eb264b9686728a5787ed5dac
- #: ../../library/re.rst:72
- msgid ""
- "Regular expressions can contain both special and ordinary characters. Most "
- "ordinary characters, like ``'A'``, ``'a'``, or ``'0'``, are the simplest "
- "regular expressions; they simply match themselves. You can concatenate "
- "ordinary characters, so ``last`` matches the string ``'last'``. (In the "
- "rest of this section, we'll write RE's in ``this special style``, usually "
- "without quotes, and strings to be matched ``'in single quotes'``.)"
- msgstr "正規表現には、特殊文字と通常文字の両方を含めることができます。``'A'``、``'a'``、あるいは ``'0'`` のようなほとんどの通常文字は最も簡単な正規表現になります。こうした文字は、単純にその文字自体にマッチします。通常の文字は連結できるので、``last`` は文字列 ``'last'`` とマッチします。(この節の以降の説明では、正規表現を引用符を使わずに ``この表示スタイル: special style`` で書き、マッチ対象の文字列は、``'引用符で括って'`` 書きます。)"
- # 5d38edace05649c781004617a0c08fcc
- #: ../../library/re.rst:79
- msgid ""
- "Some characters, like ``'|'`` or ``'('``, are special. Special characters "
- "either stand for classes of ordinary characters, or affect how the regular "
- "expressions around them are interpreted. Regular expression pattern strings "
- "may not contain null bytes, but can specify the null byte using a "
- "``\\number`` notation such as ``'\\x00'``."
- msgstr "``'|'`` や ``'('`` といったいくつかの文字は特殊文字です。特殊文字は通常の文字の種別を表したり、あるいは特殊文字の周辺にある通常の文字に対する解釈方法に影響します。正規表現パターン文字列には、null byte を含めることができませんが、``\\number`` 記法や、``'\\x00'`` などとして指定することができます。"
- # a1ab48f6bb104618b417e1c0c9f6409a
- #: ../../library/re.rst:86
- msgid "The special characters are:"
- msgstr "特殊文字を以下に示します:"
- # 26a82dd2764b41328b515371a844228c
- #: ../../library/re.rst:91
- msgid "``'.'``"
- msgstr "``'.'``"
- # 8608ed81d3c5493985b66d12b9cd2909
- #: ../../library/re.rst:89
- msgid ""
- "(Dot.) In the default mode, this matches any character except a newline. "
- "If the :const:`DOTALL` flag has been specified, this matches any character "
- "including a newline."
- msgstr "(ドット) デフォルトのモードでは改行以外の任意の文字にマッチします。:const:`DOTALL` フラグが指定されていれば改行も含むすべての文字にマッチします。"
- # f494cc2181fd4dcf842afee1a2d42b92
- #: ../../library/re.rst:95
- msgid "``'^'``"
- msgstr "``'^'``"
- # 8bc94827e9654c0499a999c82bbc9935
- #: ../../library/re.rst:94
- msgid ""
- "(Caret.) Matches the start of the string, and in :const:`MULTILINE` mode "
- "also matches immediately after each newline."
- msgstr "(キャレット) 文字列の先頭とマッチします。:const:`MULTILINE` モードでは各改行の直後にマッチします。"
- # d45b11575adb4f40874bec9a04d61366
- #: ../../library/re.rst:104
- msgid "``'$'``"
- msgstr "``'$'``"
- # 28dc29f6d1d947dcae511a9291ec26f5
- #: ../../library/re.rst:98
- msgid ""
- "Matches the end of the string or just before the newline at the end of the "
- "string, and in :const:`MULTILINE` mode also matches before a newline. "
- "``foo`` matches both 'foo' and 'foobar', while the regular expression "
- "``foo$`` matches only 'foo'. More interestingly, searching for ``foo.$`` in"
- " ``'foo1\\nfoo2\\n'`` matches 'foo2' normally, but 'foo1' in "
- ":const:`MULTILINE` mode; searching for a single ``$`` in ``'foo\\n'`` will "
- "find two (empty) matches: one just before the newline, and one at the end of"
- " the string."
- msgstr "文字列の末尾、あるいは文字列の末尾の改行の直前にマッチします。例えば、``foo`` は 'foo' と 'foobar' の両方にマッチします。一方、正規表現 ``foo$`` は 'foo' だけとマッチします。興味深いことに、``'foo1\\nfoo2\\n'`` を ``foo.$`` で検索した場合、通常のモードでは 'foo2' だけにマッチし、:const:`MULTILINE` モードでは 'foo1' にもマッチします。``$`` だけで ``'foo\\n'`` を検索した場合、2箇所 (内容は空) でマッチします: 1つは、改行の直前で、もう1つは、文字列の最後です。"
- # 0d51ecc5ca8b4d4bacbce075998ae2c8
- #: ../../library/re.rst:109
- msgid "``'*'``"
- msgstr "``'*'``"
- # a9faee5c42ce4a4d98825857eb3455ec
- #: ../../library/re.rst:107
- msgid ""
- "Causes the resulting RE to match 0 or more repetitions of the preceding RE, "
- "as many repetitions as are possible. ``ab*`` will match 'a', 'ab', or 'a' "
- "followed by any number of 'b's."
- msgstr "直前にある RE に作用して、RE を 0 回以上できるだけ多く繰り返したものにマッチさせるようにします。例えば ``ab*`` は 'a'、'ab'、あるいは 'a' に任意個数の 'b' を続けたものにマッチします。"
- # cf40e6dae9ef4a41bf411dc78dff9889
- #: ../../library/re.rst:114
- msgid "``'+'``"
- msgstr "``'+'``"
- # 5643385c828244beb8a76826c0b5c096
- #: ../../library/re.rst:112
- msgid ""
- "Causes the resulting RE to match 1 or more repetitions of the preceding RE. "
- "``ab+`` will match 'a' followed by any non-zero number of 'b's; it will not "
- "match just 'a'."
- msgstr "直前にある RE に作用して、RE を、1 回以上繰り返したものにマッチさせるようにします。例えば ``ab+`` は 'a' に一つ以上の 'b' が続いたものにマッチし、'a' 単体にはマッチしません。"
- # 0eb048391e82458d94b7ec75cf9b245b
- #: ../../library/re.rst:118
- msgid "``'?'``"
- msgstr "``'?'``"
- # e571b407d7e54c919d3fa12f59b09b79
- #: ../../library/re.rst:117
- msgid ""
- "Causes the resulting RE to match 0 or 1 repetitions of the preceding RE. "
- "``ab?`` will match either 'a' or 'ab'."
- msgstr "直前にある RE に作用して、RE を 0 回か 1 回繰り返したものにマッチさせるようにします。例えば ``ab?`` は 'a' あるいは 'ab' にマッチします。"
- # 36143788b89c461fbdc700b010afd7cd
- #: ../../library/re.rst:127
- msgid "``*?``, ``+?``, ``??``"
- msgstr "``*?``, ``+?``, ``??``"
- # 8b5a5f5a760f4ceaa43b35b9d5493d5f
- #: ../../library/re.rst:121
- msgid ""
- "The ``'*'``, ``'+'``, and ``'?'`` qualifiers are all :dfn:`greedy`; they "
- "match as much text as possible. Sometimes this behaviour isn't desired; if "
- "the RE ``<.*>`` is matched against ``'<H1>title</H1>'``, it will match the "
- "entire string, and not just ``'<H1>'``. Adding ``'?'`` after the qualifier "
- "makes it perform the match in :dfn:`non-greedy` or :dfn:`minimal` fashion; "
- "as *few* characters as possible will be matched. Using ``.*?`` in the "
- "previous expression will match only ``'<H1>'``."
- msgstr "``'*'`` 、``'+'``、``'?'`` といった修飾子は、すべて :dfn:`貪欲 (greedy)` マッチ、すなわちできるだけ多くのテキストにマッチするようになっています。時にはこの動作が望ましくない場合もあります。例えば正規表現 ``<.*>`` を ``'<H1>title</H1>'`` にマッチさせると、``'<H1>'`` だけにマッチするのではなく全文字列にマッチしてしまいます。``'?'`` を修飾子の後に追加すると、:dfn:`非貪欲 (non-greedy)` あるいは :dfn:`最小一致 (minimal)` のマッチになり、できるだけ *少ない* 文字数のマッチになります。例えば上の式で ``.*?`` を使うと ``'<H1>'`` だけにマッチします。"
- # 6971524b463a4f37a058acbcb036060b
- #: ../../library/re.rst:132
- msgid "``{m}``"
- msgstr "``{m}``"
- # 48d78f79631a4eca853b7538a3a677f3
- #: ../../library/re.rst:130
- msgid ""
- "Specifies that exactly *m* copies of the previous RE should be matched; "
- "fewer matches cause the entire RE not to match. For example, ``a{6}`` will "
- "match exactly six ``'a'`` characters, but not five."
- msgstr "前にある RE の *m* 回の正確なコピーとマッチすべきであることを指定します; マッチ回数が少なければ、RE 全体ではマッチしません。例えば、``a{6}`` は、正確に 6 個の ``'a'`` 文字とマッチしますが、5 個ではマッチしません。"
- # 0dbe7aac0d654496ac632d490eb32597
- #: ../../library/re.rst:141
- msgid "``{m,n}``"
- msgstr "``{m,n}``"
- # 978d8202a0144b1db8ab0e9b5c0725b5
- #: ../../library/re.rst:135
- msgid ""
- "Causes the resulting RE to match from *m* to *n* repetitions of the "
- "preceding RE, attempting to match as many repetitions as possible. For "
- "example, ``a{3,5}`` will match from 3 to 5 ``'a'`` characters. Omitting *m*"
- " specifies a lower bound of zero, and omitting *n* specifies an infinite "
- "upper bound. As an example, ``a{4,}b`` will match ``aaaab`` or a thousand "
- "``'a'`` characters followed by a ``b``, but not ``aaab``. The comma may not "
- "be omitted or the modifier would be confused with the previously described "
- "form."
- msgstr "結果の RE は、前にある RE を、*m* 回から *n* 回まで繰り返したもので、できるだけ多く繰り返したものとマッチするように、マッチします。例えば、``a{3,5}`` は、3個から 5個の ``'a'`` 文字とマッチします。*m* を省略するとマッチ回数の下限として0を指定した事になり、*n* を省略することは、上限が無限であることを指定します; ``a{4,}b`` は ``aaaab`` や、1,000 個の ``'a'`` 文字に ``b`` が続いたものとマッチしますが、``aaab`` とはマッチしません。コンマは省略できません、省略すると修飾子が上で述べた形式と混同されてしまうからです。"
- # 2ebd413c87e34ae3bd2886233b826a41
- #: ../../library/re.rst:148
- msgid "``{m,n}?``"
- msgstr "``{m,n}?``"
- # 317a68fbdf254c4c84e27255f56a2443
- #: ../../library/re.rst:144
- msgid ""
- "Causes the resulting RE to match from *m* to *n* repetitions of the "
- "preceding RE, attempting to match as *few* repetitions as possible. This is"
- " the non-greedy version of the previous qualifier. For example, on the "
- "6-character string ``'aaaaaa'``, ``a{3,5}`` will match 5 ``'a'`` characters,"
- " while ``a{3,5}?`` will only match 3 characters."
- msgstr "結果の RE は、前にある RE の *m* 回から *n* 回まで繰り返したもので、できるだけ *少なく* 繰り返したものとマッチするように、マッチします。これは、前の修飾子の控え目バージョンです。例えば、6 文字文字列 ``'aaaaaa'`` では、 ``a{3,5}`` は、5 個の ``'a'`` 文字とマッチしますが、``a{3,5}?`` は 3 個の文字とマッチするだけです。"
- # 51777eb4738d4618bf7feaf6b7fb061c
- #: ../../library/re.rst:161
- msgid "``'\\'``"
- msgstr "``'\\'``"
- # 576b93d56c0b4d7aacbc8410eaa2af4b
- #: ../../library/re.rst:151
- msgid ""
- "Either escapes special characters (permitting you to match characters like "
- "``'*'``, ``'?'``, and so forth), or signals a special sequence; special "
- "sequences are discussed below."
- msgstr "特殊文字をエスケープする (``'*'`` や ``'?'`` 等のような文字とのマッチをできるようにする) か、あるいは、特殊シーケンスの合図です; 特殊シーケンスは後で説明します。"
- # 4ecee429ad604581956a13433cef25f6
- #: ../../library/re.rst:155
- msgid ""
- "If you're not using a raw string to express the pattern, remember that "
- "Python also uses the backslash as an escape sequence in string literals; if "
- "the escape sequence isn't recognized by Python's parser, the backslash and "
- "subsequent character are included in the resulting string. However, if "
- "Python would recognize the resulting sequence, the backslash should be "
- "repeated twice. This is complicated and hard to understand, so it's highly "
- "recommended that you use raw strings for all but the simplest expressions."
- msgstr "もしパターンを表現するのに raw 文字列を使用していないのであれば、Python も、バックスラッシュを文字列リテラルでのエスケープシーケンスとして使っていることを覚えておいて下さい; もしエスケープシーケンスを Python の構文解析器が認識して処理しなければ、そのバックスラッシュとそれに続く文字は、結果の文字列にそのまま含まれます。しかし、もし Python が結果のシーケンスを認識するのであれば、バックスラッシュを 2 回繰り返さなければなりません。このことは複雑で理解しにくいので、最も簡単な表現以外は、すべて raw 文字列を使うことを強く推奨します。"
- # f2b925df5b3347b68e2f0f3e6ad9b1df
- #: ../../library/re.rst:193
- msgid "``[]``"
- msgstr "``[]``"
- # 5a4f1d25082147889b22b1376da0f86b
- #: ../../library/re.rst:164
- msgid "Used to indicate a set of characters. In a set:"
- msgstr "文字の集合を指定するのに使用します。集合には以下のものが指定できます:"
- # 3fd60fddd6ff4f4c84f1f751fb173292
- #: ../../library/re.rst:166
- msgid ""
- "Characters can be listed individually, e.g. ``[amk]`` will match ``'a'``, "
- "``'m'``, or ``'k'``."
- msgstr "個別に指定できる文字。``[amk]`` は ``'a'``、``'m'``、または ``'k'`` とマッチします。"
- # 14ea04b2480d40779be07f0eb03a994c
- #: ../../library/re.rst:169
- msgid ""
- "Ranges of characters can be indicated by giving two characters and "
- "separating them by a ``'-'``, for example ``[a-z]`` will match any lowercase"
- " ASCII letter, ``[0-5][0-9]`` will match all the two-digits numbers from "
- "``00`` to ``59``, and ``[0-9A-Fa-f]`` will match any hexadecimal digit. If "
- "``-`` is escaped (e.g. ``[a\\-z]``) or if it's placed as the first or last "
- "character (e.g. ``[a-]``), it will match a literal ``'-'``."
- msgstr "連続した文字の範囲を、先頭と最後の2文字とその間に ``'-'`` を挟んだ形で指定できます。``[a-z]`` はすべての小文字の ASCII 文字とマッチします。``[0-5][0-9]`` は ``00`` から ``59`` までの、すべての 2 桁の数字とマッチします。``[0-9A-Fa-f]`` はすべての 16 進数とマッチします。``-`` が、エスケープされた場合 (例: ``[a\\-z]``)、あるいは先頭か末尾に置かれた場合 (例: ``[a-]``)、リテラル ``'-'`` とマッチします。"
- # 9e0fc2c27d8e418e823f774ccb28c4c7
- #: ../../library/re.rst:176
- msgid ""
- "Special characters lose their special meaning inside sets. For example, "
- "``[(+*)]`` will match any of the literal characters ``'('``, ``'+'``, "
- "``'*'``, or ``')'``."
- msgstr "集合内では、特殊文字はその意味を失います。``[(+*)]`` はリテラル文字 ``'('``、``'+'``、``'*'``、あるいは ``')'`` のいずれかとマッチします。"
- # 9e5c6edd7d654dd18ff8e17304284dcf
- #: ../../library/re.rst:180
- msgid ""
- "Character classes such as ``\\w`` or ``\\S`` (defined below) are also "
- "accepted inside a set, although the characters they match depends on whether"
- " :const:`ASCII` or :const:`LOCALE` mode is in force."
- msgstr "``\\w`` や ``\\S`` のような文字クラス (後述) も集合内に指定できますが、それらにマッチする文字は :const:`ASCII` か :const:`LOCALE` のどちらか有効にされているモードに依存します。"
- # 9a30dc0ed4f04e758a9bafbc92354e72
- #: ../../library/re.rst:184
- msgid ""
- "Characters that are not within a range can be matched by "
- ":dfn:`complementing` the set. If the first character of the set is ``'^'``,"
- " all the characters that are *not* in the set will be matched. For example,"
- " ``[^5]`` will match any character except ``'5'``, and ``[^^]`` will match "
- "any character except ``'^'``. ``^`` has no special meaning if it's not the "
- "first character in the set."
- msgstr "範囲内にない文字とは、その集合の :dfn:`補集合` をとることでマッチできます。集合の最初の文字が ``'^'`` の時、集合に *ない* 文字すべてとマッチします。``[^5]`` は ``'5'`` を除くあらゆる文字にマッチします。``[^^]`` は ``'^'`` を除くあらゆる文字にマッチします。``^`` は集合の最初の文字でない限り特別の意味を持ちません。"
- # b5eb496a612840feb9f49a09ce1937ae
- #: ../../library/re.rst:191
- msgid ""
- "To match a literal ``']'`` inside a set, precede it with a backslash, or "
- "place it at the beginning of the set. For example, both ``[()[\\]{}]`` and "
- "``[]()[{}]`` will both match a parenthesis."
- msgstr "集合内でリテラル ``']'`` をマッチさせるには、その前にバックスラッシュをつけるか、集合の先頭に置きます。``[()[\\]{}]`` と ``[]()[{}]`` はどちらも ``']'`` にマッチします。"
- # 7a5e993ecf574f55bd77be3f8f5ecd45
- #: ../../library/re.rst:204
- msgid "``'|'``"
- msgstr "``'|'``"
- # 40a73048203148429945b7a955f87227
- #: ../../library/re.rst:196
- msgid ""
- "``A|B``, where A and B can be arbitrary REs, creates a regular expression "
- "that will match either A or B. An arbitrary number of REs can be separated "
- "by the ``'|'`` in this way. This can be used inside groups (see below) as "
- "well. As the target string is scanned, REs separated by ``'|'`` are tried "
- "from left to right. When one pattern completely matches, that branch is "
- "accepted. This means that once ``A`` matches, ``B`` will not be tested "
- "further, even if it would produce a longer overall match. In other words, "
- "the ``'|'`` operator is never greedy. To match a literal ``'|'``, use "
- "``\\|``, or enclose it inside a character class, as in ``[|]``."
- msgstr "``A|B`` (A と B は任意の RE) は、A か B のどちらかとマッチする正規表現を作成します。任意個数の RE を、このように ``'|'`` で分離することができます。これはグループ (下記参照) 内部でも使えます。走査対象文字列をスキャンする中で、``'|'`` で分離された RE は左から右への順に走査されます。一つでも完全にマッチしたパターンがあれば、そのパターン枝が受理されます。このことは、もし ``A`` がマッチすれば、たとえ ``B`` によるマッチが全体としてより長いマッチになったとしても、``B`` を決して走査しないことを意味します。言いかえると、``'|'`` 演算子は決して貪欲 (greedy) にはなりません。リテラル ``'|'`` とマッチするには、``\\|`` を使うか、あるいは ``[|]`` のように文字クラス内に入れます。"
- # d33d91b6a3094c3fbb7ed154485c5c0d
- #: ../../library/re.rst:211
- msgid "``(...)``"
- msgstr "``(...)``"
- # 630d185934a84fe89eb5652a7d9f1f9e
- #: ../../library/re.rst:207
- msgid ""
- "Matches whatever regular expression is inside the parentheses, and indicates"
- " the start and end of a group; the contents of a group can be retrieved "
- "after a match has been performed, and can be matched later in the string "
- "with the ``\\number`` special sequence, described below. To match the "
- "literals ``'('`` or ``')'``, use ``\\(`` or ``\\)``, or enclose them inside "
- "a character class: ``[(] [)]``."
- msgstr "丸括弧の中にどのような正規表現があってもマッチし、丸括弧はグループの開始と終了を表します; グループの中身は、マッチが実行された後に回収され、特殊シーケンス ``\\number`` (後述) で参照することができます。リテラル ``'('`` や ``')'`` とマッチするには、``\\(`` や ``\\)`` を使うか、それらを文字クラス内に入れます: ``[(] [)]``。"
- # a7df3b3b5c1040d5a65df67cc86b098c
- #: ../../library/re.rst:218
- msgid "``(?...)``"
- msgstr "``(?...)``"
- # d0889816d7164b589720d8c3ad863c6b
- #: ../../library/re.rst:214
- msgid ""
- "This is an extension notation (a ``'?'`` following a ``'('`` is not "
- "meaningful otherwise). The first character after the ``'?'`` determines "
- "what the meaning and further syntax of the construct is. Extensions usually "
- "do not create a new group; ``(?P<name>...)`` is the only exception to this "
- "rule. Following are the currently supported extensions."
- msgstr "これは拡張記法です (``'('`` に続く ``'?'`` は他に意味がありません)。``'?'`` の後の最初の文字が、この構造の意味とこれ以上の構文がどういうものかを決定します。拡張記法は通常新しいグループを作成しません; ``(?P<name>...)`` がこの規則の唯一の例外です。以下に現在サポートされている拡張記法を示します。"
- # 1708254eb3ae44ebb8e472e11311bc4e
- #: ../../library/re.rst:235
- msgid "``(?aiLmsux)``"
- msgstr "``(?aiLmsux)``"
- # 8be153d589854d559d889aada2c2e95a
- #: ../../library/re.rst:221
- msgid ""
- "(One or more letters from the set ``'a'``, ``'i'``, ``'L'``, ``'m'``, "
- "``'s'``, ``'u'``, ``'x'``.) The group matches the empty string; the letters"
- " set the corresponding flags: :const:`re.A` (ASCII-only matching), "
- ":const:`re.I` (ignore case), :const:`re.L` (locale dependent), :const:`re.M`"
- " (multi-line), :const:`re.S` (dot matches all), and :const:`re.X` (verbose),"
- " for the entire regular expression. (The flags are described in :ref"
- ":`contents-of-module-re`.) This is useful if you wish to include the flags "
- "as part of the regular expression, instead of passing a *flag* argument to "
- "the :func:`re.compile` function."
- msgstr "(集合 ``'a'``, ``'i'``, ``'L'``, ``'m'``, ``'s'``, ``'u'``, ``'x'`` から1文字以上)。グループは空文字列ともマッチします; 文字は、正規表現全体の対応するフラグ :const:`re.A` (ASCII 限定マッチ)、:const:`re.I` (大文字・小文字を区別しない)、:const:`re.L` (ロケール依存)、:const:`re.M` (MULTILINE モード)、:const:`re.S` (DOTALL モード)、および :const:`re.X` (冗長) を設定します (フラグについては :ref:`contents-of-module-re` を参照)。これは、*flag* 引数を :func:`re.compile` 関数に渡すのではなく、そのフラグを正規表現の一部に含めたい場合に役立ちます。"
- # 3356bb20b9a64e1885c9458ab5cd205b
- #: ../../library/re.rst:232
- msgid ""
- "Note that the ``(?x)`` flag changes how the expression is parsed. It should "
- "be used first in the expression string, or after one or more whitespace "
- "characters. If there are non-whitespace characters before the flag, the "
- "results are undefined."
- msgstr "``(?x)`` フラグは、表現の解析方法を変更することに注意して下さい。これは表現文字列内の最初か、あるいは 1 つ以上の空白文字の後で使うべきです。このフラグの前に非空白文字がある場合の結果は定義されていません。"
- # b537ffceadc74458a8fb953d03447166
- #: ../../library/re.rst:241
- msgid "``(?:...)``"
- msgstr "``(?:...)``"
- # 91d58d5966dd4d6f9015bcdeac79f46b
- #: ../../library/re.rst:238
- msgid ""
- "A non-capturing version of regular parentheses. Matches whatever regular "
- "expression is inside the parentheses, but the substring matched by the group"
- " *cannot* be retrieved after performing a match or referenced later in the "
- "pattern."
- msgstr "正規表現の丸括弧をキャプチャしないバージョンです。丸括弧内にどのような正規表現があってもマッチしますが、グループにマッチされたサブ文字列は、マッチを実行したあと回収することも、後でパターンで参照することも *できません* 。"
- # bc1dc008103c49cbbb537dddca93d608
- #: ../../library/re.rst:266
- msgid "``(?P<name>...)``"
- msgstr "``(?P<name>...)``"
- # 7a19633ed134421499d054b19e203a61
- #: ../../library/re.rst:244
- msgid ""
- "Similar to regular parentheses, but the substring matched by the group is "
- "accessible via the symbolic group name *name*. Group names must be valid "
- "Python identifiers, and each group name must be defined only once within a "
- "regular expression. A symbolic group is also a numbered group, just as if "
- "the group were not named."
- msgstr ""
- # 04cf130d38824980878d42d41e8a2a0f
- #: ../../library/re.rst:250
- msgid ""
- "Named groups can be referenced in three contexts. If the pattern is "
- "``(?P<quote>['\"]).*?(?P=quote)`` (i.e. matching a string quoted with either"
- " single or double quotes):"
- msgstr ""
- # 5cae64a3a4a746c7bc3d8c01628e6929
- #: ../../library/re.rst:255
- msgid "Context of reference to group \"quote\""
- msgstr ""
- # f8fdcc747ac04e499eac18d1bebdf503
- #: ../../library/re.rst:255
- msgid "Ways to reference it"
- msgstr ""
- # f8a0715fb18b48748489508badec1c83
- #: ../../library/re.rst:257
- msgid "in the same pattern itself"
- msgstr ""
- # fb2cc376e29d4f8890971e679b44f7c8
- #: ../../library/re.rst:257
- msgid "``(?P=quote)`` (as shown)"
- msgstr ""
- # f2c4eb67a17c44d5afbe62f25f59bfdf
- # 17074ddecda34b9197417daea44eef82
- #: ../../library/re.rst:258 ../../library/re.rst:265
- msgid "``\\1``"
- msgstr ""
- # b26ba6a3de264a798645adc3ab3eef01
- #: ../../library/re.rst:260
- msgid "when processing match object ``m``"
- msgstr ""
- # 38507046b8f74e858133c539c8efb1d6
- #: ../../library/re.rst:260
- msgid "``m.group('quote')``"
- msgstr ""
- # 36773553c0424650af95b27596cfc367
- #: ../../library/re.rst:261
- msgid "``m.end('quote')`` (etc.)"
- msgstr ""
- # e83c33022f6b4ba4b89efd8f4c2d84a0
- #: ../../library/re.rst:263
- msgid "in a string passed to the ``repl`` argument of ``re.sub()``"
- msgstr ""
- # 9a02dc5441ae4e82b844699f3cbbf8bc
- #: ../../library/re.rst:263
- msgid "``\\g<quote>``"
- msgstr ""
- # dd9560b9d0824d08b714d5cf45734e93
- #: ../../library/re.rst:264
- msgid "``\\g<1>``"
- msgstr ""
- # 01e71a73c09b4a10b6f2165417931f8c
- #: ../../library/re.rst:270
- msgid "``(?P=name)``"
- msgstr "``(?P=name)``"
- # 230694368ab043feb148c6a26a5ad6f0
- #: ../../library/re.rst:269
- msgid ""
- "A backreference to a named group; it matches whatever text was matched by "
- "the earlier group named *name*."
- msgstr ""
- # 783e6e03ca014cfeb0162315bda9defd
- #: ../../library/re.rst:273
- msgid "``(?#...)``"
- msgstr "``(?#...)``"
- # 0b10267e754c478d8ddf23f9ddddec2e
- #: ../../library/re.rst:273
- msgid "A comment; the contents of the parentheses are simply ignored."
- msgstr "コメントです; 括弧の内容は無視されます。"
- # fa4dab5d027a4962b3298cdcf854ddab
- #: ../../library/re.rst:278
- msgid "``(?=...)``"
- msgstr "``(?=...)``"
- # e9c1f4d1c99644788217488345b30080
- #: ../../library/re.rst:276
- msgid ""
- "Matches if ``...`` matches next, but doesn't consume any of the string. "
- "This is called a lookahead assertion. For example, ``Isaac (?=Asimov)`` "
- "will match ``'Isaac '`` only if it's followed by ``'Asimov'``."
- msgstr "``...`` が次に続くものとマッチすればマッチしますが、文字列をまったく消費しません。これは先読みアサーション (lookahead assertion) と呼ばれます。例えば、``Isaac (?=Asimov)`` は、``'Isaac '`` に ``'Asimov'`` が続く場合だけ、``'Isaac '`` とマッチします。"
- # a7ae214b9fc84adcb9d5a857f48da399
- #: ../../library/re.rst:283
- msgid "``(?!...)``"
- msgstr "``(?!...)``"
- # 1f67431bb2c6475e896a33cbeeac4107
- #: ../../library/re.rst:281
- msgid ""
- "Matches if ``...`` doesn't match next. This is a negative lookahead "
- "assertion. For example, ``Isaac (?!Asimov)`` will match ``'Isaac '`` only if"
- " it's *not* followed by ``'Asimov'``."
- msgstr "``...`` が次に続くものとマッチしなければマッチします。これは否定先読みアサーション (negative lookahead assertion) です。例えば、``Isaac (?!Asimov)`` は、``'Isaac '`` に ``'Asimov'`` が続か *ない* 場合のみマッチします。"
- # 75976af3d26d4b669d54ec944d496eb3
- #: ../../library/re.rst:305
- msgid "``(?<=...)``"
- msgstr "``(?<=...)``"
- # 3faeae5d2593422c86d4dece0ba05ea8
- #: ../../library/re.rst:286
- msgid ""
- "Matches if the current position in the string is preceded by a match for "
- "``...`` that ends at the current position. This is called a :dfn:`positive "
- "lookbehind assertion`. ``(?<=abc)def`` will find a match in ``abcdef``, "
- "since the lookbehind will back up 3 characters and check if the contained "
- "pattern matches. The contained pattern must only match strings of some fixed"
- " length, meaning that ``abc`` or ``a|b`` are allowed, but ``a*`` and "
- "``a{3,4}`` are not. Note that patterns which start with positive lookbehind"
- " assertions will not match at the beginning of the string being searched; "
- "you will most likely want to use the :func:`search` function rather than the"
- " :func:`match` function:"
- msgstr "文字列内の現在位置の前に、現在位置で終わる ``...`` とのマッチがあれば、マッチします。これは :dfn:`後読みアサーション` と呼ばれます。``(?<=abc)def`` は ``abcdef`` にマッチを見つけます。後読みは 3 文字をバックアップし、含まれているパターンとマッチするかどうか検査します。含まれるパターンは、固定長の文字列にのみマッチしなければなりません。すなわち、``abc`` や ``a|b`` は許されますが、``a*`` や ``a{3,4}`` は許されません。肯定後読みアサーションで始まるパターンは、検索される文字列の先頭とは決してマッチしないことに注意して下さい; この表現を使用するのは、おそらく :func:`match` 関数より :func:`search` 関数の方が適しています:"
- # 1706c17163514a5294e844f6d1a990e2
- #: ../../library/re.rst:301
- msgid "This example looks for a word following a hyphen:"
- msgstr "この例ではハイフンに続く単語を探します:"
- # c105d6ac08bb447fa31dcece73070b3f
- #: ../../library/re.rst:312
- msgid "``(?<!...)``"
- msgstr "``(?<!...)``"
- # 5484e8a54f7146c5bb88d3dc911966d8
- #: ../../library/re.rst:308
- msgid ""
- "Matches if the current position in the string is not preceded by a match for"
- " ``...``. This is called a :dfn:`negative lookbehind assertion`. Similar "
- "to positive lookbehind assertions, the contained pattern must only match "
- "strings of some fixed length. Patterns which start with negative lookbehind"
- " assertions may match at the beginning of the string being searched."
- msgstr "文字列内の現在位置の前に ``...`` とのマッチがない場合に、マッチします。これは :dfn:`否定後読みアサーション(negative lookbehind assertion)` と呼ばれます。肯定後読みアサーションと同様に、含まれるパターンは固定長さの文字列だけにマッチしなければなりません。否定後読みアサーションで始まるパターンは、検索される文字列の先頭とマッチできます。"
- # ab4fd2f3059b4f569d8238e12b351e18
- #: ../../library/re.rst:321
- msgid "``(?(id/name)yes-pattern|no-pattern)``"
- msgstr "``(?(id/name)yes-pattern|no-pattern)``"
- # a7f540eb6d0946e9a888cc8899207581
- #: ../../library/re.rst:315
- msgid ""
- "Will try to match with ``yes-pattern`` if the group with given *id* or "
- "*name* exists, and with ``no-pattern`` if it doesn't. ``no-pattern`` is "
- "optional and can be omitted. For example, "
- "``(<)?(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$)`` is a poor email matching pattern, "
- "which will match with ``'<user@host.com>'`` as well as ``'user@host.com'``, "
- "but not with ``'<user@host.com'`` nor ``'user@host.com>'``."
- msgstr ""
- # edd2b8a8704249e1b8652410d69b7a7f
- #: ../../library/re.rst:323
- msgid ""
- "The special sequences consist of ``'\\'`` and a character from the list "
- "below. If the ordinary character is not on the list, then the resulting RE "
- "will match the second character. For example, ``\\$`` matches the character"
- " ``'$'``."
- msgstr "特殊シーケンスは ``'\\'`` と以下のリストの文字から構成されます。リストにない通常文字の場合 RE は 2 番目の文字とマッチします。例えば、``\\$`` は文字 ``'$'`` とマッチします。"
- # 780018588a6847089545672f09c3741f
- #: ../../library/re.rst:335
- msgid "``\\number``"
- msgstr "``\\number``"
- # e117423d8d3041329ea7b07f041592f5
- #: ../../library/re.rst:328
- msgid ""
- "Matches the contents of the group of the same number. Groups are numbered "
- "starting from 1. For example, ``(.+) \\1`` matches ``'the the'`` or ``'55 "
- "55'``, but not ``'thethe'`` (note the space after the group). This special "
- "sequence can only be used to match one of the first 99 groups. If the first"
- " digit of *number* is 0, or *number* is 3 octal digits long, it will not be "
- "interpreted as a group match, but as the character with octal value "
- "*number*. Inside the ``'['`` and ``']'`` of a character class, all numeric "
- "escapes are treated as characters."
- msgstr ""
- # eddd7c0e2752450f9628234b1e2646ba
- #: ../../library/re.rst:338
- msgid "``\\A``"
- msgstr "``\\A``"
- # 8be782690a754cdea3d5cf2c8dcb3596
- #: ../../library/re.rst:338
- msgid "Matches only at the start of the string."
- msgstr "文字列の先頭だけにマッチします。"
- # b95dcfc643ca4195a2147fac10658e11
- #: ../../library/re.rst:353
- msgid "``\\b``"
- msgstr "``\\b``"
- # 82107550c05b44b1b5b0eaabc5e4d52b
- #: ../../library/re.rst:341
- msgid ""
- "Matches the empty string, but only at the beginning or end of a word. A word"
- " is defined as a sequence of Unicode alphanumeric or underscore characters, "
- "so the end of a word is indicated by whitespace or a non-alphanumeric, non-"
- "underscore Unicode character. Note that formally, ``\\b`` is defined as the"
- " boundary between a ``\\w`` and a ``\\W`` character (or vice versa), or "
- "between ``\\w`` and the beginning/end of the string. This means that "
- "``r'\\bfoo\\b'`` matches ``'foo'``, ``'foo.'``, ``'(foo)'``, ``'bar foo "
- "baz'`` but not ``'foobar'`` or ``'foo3'``."
- msgstr "空文字列とマッチしますが、単語の先頭か末尾の時だけです。単語とは Unicode 英数字 (日本語など英字以外も含む非記号) またはアンダースコアからなるシーケンスで、単語の終わりは空白文字、あるいはアンダースコアを除く記号で表します。``\\\\b`` は ``\\\\w`` および ``\\\\W`` の間 (およびその逆) あるいは ``\\\\w`` と文字列の開始/終了との間の境界として定義されています。例えば、``r'\\\\bfoo\\\\b'`` は ``'foo'``、``'foo.'``、``'(foo)'``、``'bar foo baz'`` にマッチしますが、``'foobar'`` や ``'foo3'`` にはマッチしません。"
- # b1f8bba1f14e499da80f7369cb962f71
- #: ../../library/re.rst:350
- msgid ""
- "By default Unicode alphanumerics are the ones used, but this can be changed"
- " by using the :const:`ASCII` flag. Inside a character range, ``\\b`` "
- "represents the backspace character, for compatibility with Python's string "
- "literals."
- msgstr "デフォルトでは、Unicode 英数字 (日本語など英字以外も含む非記号) が使用されますが、これは :const:`ASCII` フラグを使って ASCII に限定できます。文字範囲内では、``\\\\b`` は Python の文字列リテラルとの互換性のため、後退 (backspace) 文字を表します。"
- # fba105aaf66a40ae90f1be2db403d366
- #: ../../library/re.rst:361
- msgid "``\\B``"
- msgstr "``\\B``"
- # 48e0e2202f3e4fa0a0c4e91cf36bd42f
- #: ../../library/re.rst:356
- msgid ""
- "Matches the empty string, but only when it is *not* at the beginning or end "
- "of a word. This means that ``r'py\\B'`` matches ``'python'``, ``'py3'``, "
- "``'py2'``, but not ``'py'``, ``'py.'``, or ``'py!'``. ``\\B`` is just the "
- "opposite of ``\\b``, so word characters are Unicode alphanumerics or the "
- "underscore, although this can be changed by using the :const:`ASCII` flag."
- msgstr "空文字列とマッチしますが、それが単語の先頭あるいは末尾に *ない* 時だけです。``r'py\\\\B'`` は ``'python'``、``'py3'``、``'py2'`` にはマッチしますが、``'py'``、``'py.'``、あるいは ``'py!'`` にはマッチしません。``\\\\B`` は ``\\\\b`` のちょうど反対で、単語の文字は Unicode 英数字 (日本語など英字以外も含む非記号) またはアンダースコアですが、:const:`ASCII` フラグで ASCII に限定できます。"
- # 00d966883406411984f8add175326807
- #: ../../library/re.rst:372
- msgid "``\\d``"
- msgstr "``\\d``"
- # 63211587d977418d9a3c0f03fba0a89f
- # 5f75052176224188b5e696c2c9f4467e
- # e2fd59dec88244bf94353621c9030ec4
- #: ../../library/re.rst:369 ../../library/re.rst:389 ../../library/re.rst:408
- msgid "For Unicode (str) patterns:"
- msgstr "ユニコード (str) パターンに対して:"
- # 70979492aa214a25b197a7170270b4a5
- #: ../../library/re.rst:365
- msgid ""
- "Matches any Unicode decimal digit (that is, any character in Unicode "
- "character category [Nd]). This includes ``[0-9]``, and also many other "
- "digit characters. If the :const:`ASCII` flag is used only ``[0-9]`` is "
- "matched (but the flag affects the entire regular expression, so in such "
- "cases using an explicit ``[0-9]`` may be a better choice)."
- msgstr "任意の Unicode 10進数 (Unicode 文字カテゴリ [Nd]) とマッチします。これには ``[0-9]`` とその他の 10 進数文字が含まれます。:const:`ASCII` が使用された場合、``[0-9]`` のみマッチします。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[0-9]`` と指定する方が良い場合があるかもしれません。"
- # 677c73e1ff5942818f7d604caca97009
- # 2580599ab76c4d25bb0799238e1efaaf
- # ff8ba2d87b174a67bc0d11043179a679
- #: ../../library/re.rst:372 ../../library/re.rst:393 ../../library/re.rst:412
- msgid "For 8-bit (bytes) patterns:"
- msgstr "8bit (bytes) パターンに対して:"
- # e26fbf2fe2ab4786b901bb670e1db454
- #: ../../library/re.rst:372
- msgid "Matches any decimal digit; this is equivalent to ``[0-9]``."
- msgstr "任意の 10 進数にマッチします; これは ``[0-9]`` と等価です。"
- # 06808ee418e6430297a65475a6411237
- #: ../../library/re.rst:379
- msgid "``\\D``"
- msgstr "``\\D``"
- # 3f0e6b380c5344c3a15c0273a7cc6f2d
- #: ../../library/re.rst:375
- msgid ""
- "Matches any character which is not a Unicode decimal digit. This is the "
- "opposite of ``\\d``. If the :const:`ASCII` flag is used this becomes the "
- "equivalent of ``[^0-9]`` (but the flag affects the entire regular "
- "expression, so in such cases using an explicit ``[^0-9]`` may be a better "
- "choice)."
- msgstr "任意の非 Unicode 10 進数文字にマッチします。これは ``\\\\d`` の反対です。:const:`ASCII` フラグを使用すると ``[^0-9]`` と等価になります。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[^0-9]`` と指定する方が良い場合があるかもしれません。"
- # 3a4d3cfe12204e2281d5a2abc6ac6b78
- #: ../../library/re.rst:393
- msgid "``\\s``"
- msgstr "``\\s``"
- # b69082445df242eba01cc028d3144c01
- #: ../../library/re.rst:383
- msgid ""
- "Matches Unicode whitespace characters (which includes ``[ "
- "\\t\\n\\r\\f\\v]``, and also many other characters, for example the non-"
- "breaking spaces mandated by typography rules in many languages). If the "
- ":const:`ASCII` flag is used, only ``[ \\t\\n\\r\\f\\v]`` is matched (but the"
- " flag affects the entire regular expression, so in such cases using an "
- "explicit ``[ \\t\\n\\r\\f\\v]`` may be a better choice)."
- msgstr "任意の空白文字とマッチします。これには ``[ \\t\\n\\r\\f\\v]`` およびノーブレークスペースなど、多くの言語におけるタイポグラフィ規則で定義された文字が含まれます。:const:`ASCII` フラグを使用すると、``[ \\\\t\\\\n\\\\r\\\\f\\\\v]`` のみにマッチします。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[ \\t\\n\\r\\f\\v]`` と指定する方が良い場合があるかもしれません。"
- # 6db52065fde34619aee867de5e0ae2c7
- #: ../../library/re.rst:392
- msgid ""
- "Matches characters considered whitespace in the ASCII character set; this is"
- " equivalent to ``[ \\t\\n\\r\\f\\v]``."
- msgstr "ASCII 文字セットにおける空白文字とマッチします。これは ``[ \\t\\n\\r\\f\\v]`` と等価です。"
- # f0d26fcd41f7404082070ff95338154a
- #: ../../library/re.rst:400
- msgid "``\\S``"
- msgstr "``\\S``"
- # 2326189b52fe4f7289566a88381f7bed
- #: ../../library/re.rst:396
- msgid ""
- "Matches any character which is not a Unicode whitespace character. This is "
- "the opposite of ``\\s``. If the :const:`ASCII` flag is used this becomes the"
- " equivalent of ``[^ \\t\\n\\r\\f\\v]`` (but the flag affects the entire "
- "regular expression, so in such cases using an explicit ``[^ "
- "\\t\\n\\r\\f\\v]`` may be a better choice)."
- msgstr "任意の非空白文字にマッチします。これは ``\\s`` の反対です。:const:`ASCII` フラグを使用すると ``[^ \\t\\n\\r\\f\\v]`` と等価になります。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[^ \\t\\n\\r\\f\\v]`` と指定する方が良い場合があるかもしれません。"
- # 4a7c50e43eff43c4bc0ca6d291c5d495
- #: ../../library/re.rst:412
- msgid "``\\w``"
- msgstr "``\\w``"
- # 928c0bcebbe34f8b9ca0b6c366e50c90
- #: ../../library/re.rst:404
- msgid ""
- "Matches Unicode word characters; this includes most characters that can be "
- "part of a word in any language, as well as numbers and the underscore. If "
- "the :const:`ASCII` flag is used, only ``[a-zA-Z0-9_]`` is matched (but the "
- "flag affects the entire regular expression, so in such cases using an "
- "explicit ``[a-zA-Z0-9_]`` may be a better choice)."
- msgstr "任意の Unicode 単語文字にマッチします。これにはあらゆる言語で単語の一部になりうる文字、数字、およびアンダースコアが含まれます。:const:`ASCII` フラグを使用すると ``[a-zA-Z0-9_]`` のみにマッチします。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[a-zA-Z0-9_]`` と指定する方が良い場合があるかもしれません。"
- # ef558cb490384afcba9ac7414152496a
- #: ../../library/re.rst:411
- msgid ""
- "Matches characters considered alphanumeric in the ASCII character set; this "
- "is equivalent to ``[a-zA-Z0-9_]``."
- msgstr "ASCII 文字セットでの英数字とアンダースコアにマッチします。これは ``[a-zA-Z0-9_]`` と等価です。"
- # 9b8f967b2c4e45f2b7dab947ff4db0b8
- #: ../../library/re.rst:419
- msgid "``\\W``"
- msgstr "``\\W``"
- # 9419097ab63a49e09a0fb0bace22f7f0
- #: ../../library/re.rst:415
- msgid ""
- "Matches any character which is not a Unicode word character. This is the "
- "opposite of ``\\w``. If the :const:`ASCII` flag is used this becomes the "
- "equivalent of ``[^a-zA-Z0-9_]`` (but the flag affects the entire regular "
- "expression, so in such cases using an explicit ``[^a-zA-Z0-9_]`` may be a "
- "better choice)."
- msgstr "任意の非 Unicode 単語文字にマッチします。これは ``\\\\w`` の反対です。:const:`ASCII` フラグを使用した場合、``[^a-zA-Z0-9_]`` と等価になります。ただし、このフラグは正規表現全体に作用しますので、明示的に ``[^a-zA-Z0-9_]`` と指定する方が良い場合があるかもしれません。"
- # 166f4d99e8ac426e9b4f338969ba5885
- #: ../../library/re.rst:422
- msgid "``\\Z``"
- msgstr "``\\Z``"
- # 5ededd5cb1d540d68f49748fbfc35f83
- #: ../../library/re.rst:422
- msgid "Matches only at the end of the string."
- msgstr "文字列の末尾とのみマッチします。"
- # b05605fe2b904fec9dc9d057ba651f1e
- #: ../../library/re.rst:424
- msgid ""
- "Most of the standard escapes supported by Python string literals are also "
- "accepted by the regular expression parser::"
- msgstr "Python 文字列リテラルによってサポートされている標準エスケープのほとんども、正規表現パーサに認識されます::"
- # 4c42aef4e8584b6fa92d682a2b685c8a
- #: ../../library/re.rst:431
- msgid ""
- "(Note that ``\\b`` is used to represent word boundaries, and means "
- "\"backspace\" only inside character classes.)"
- msgstr "(``\\b`` は単語の境界を表し、文字クラス内でのみ後退 (backspace) 文字を指すことに注意してください)"
- # b9e8feacc2794fb5bb881ad410a8ba9a
- #: ../../library/re.rst:434
- msgid ""
- "``'\\u'`` and ``'\\U'`` escape sequences are only recognized in Unicode "
- "patterns. In bytes patterns they are not treated specially."
- msgstr "``'\\u'`` および ``'\\U'`` エスケープシーケンスは Unicode パターン内でのみ認識されます。バイト列では特殊文字として扱われません。"
- # 8fcae663e00b48ac930df3824cf2459e
- #: ../../library/re.rst:437
- msgid ""
- "Octal escapes are included in a limited form. If the first digit is a 0, or"
- " if there are three octal digits, it is considered an octal escape. "
- "Otherwise, it is a group reference. As for string literals, octal escapes "
- "are always at most three digits in length."
- msgstr "8 進数エスケープは限られた形式で表します。最初の桁が 0 か、あるいは 3 桁の 8 進数ならば、8 進数エスケープとみなされます。それ以外の場合はグループ参照になります。文字列リテラルに関しては、8 進数エスケープはほとんどの場合 3 桁長になります。"
- # ed3e652deef74c879420ea6b79fcbe8d
- # c4161505f53d43d3b588868dc39ab362
- #: ../../library/re.rst:442 ../../library/re.rst:442
- msgid "The ``'\\u'`` and ``'\\U'`` escape sequences have been added."
- msgstr "``'\\u'`` と ``'\\U'`` エスケープシーケンスが追加されました。"
- # 6463b69f6d314740bd4da211d915aa0d
- #: ../../library/re.rst:450
- msgid "Module Contents"
- msgstr "モジュールの内容"
- # 0ce8bbb189064fc288446a73e8d5f154
- #: ../../library/re.rst:452
- msgid ""
- "The module defines several functions, constants, and an exception. Some of "
- "the functions are simplified versions of the full featured methods for "
- "compiled regular expressions. Most non-trivial applications always use the "
- "compiled form."
- msgstr "このモジュールはいくつかの関数、定数、例外を定義します。この関数の一部はコンパイルした正規表現の完全版メソッドを簡略化したバージョンです。簡単なアプリケーションを除くほとんどで、コンパイルされた形式が用いられるのが普通です。"
- # 681a3cf5629143108075429c5f722127
- #: ../../library/re.rst:460
- msgid ""
- "Compile a regular expression pattern into a regular expression object, which"
- " can be used for matching using its :func:`match` and :func:`search` "
- "methods, described below."
- msgstr "正規表現パターンを正規表現オブジェクトにコンパイルします。このオブジェクトは、以下で述べる :func:`match` と :func:`search` メソッドを使って、マッチングに使うことができます。"
- # 6812155149c24e149c1ffb5d9b93edad
- #: ../../library/re.rst:464
- msgid ""
- "The expression's behaviour can be modified by specifying a *flags* value. "
- "Values can be any of the following variables, combined using bitwise OR (the"
- " ``|`` operator)."
- msgstr "表現の動作は、*flags* 値を指定することで調整できます。値は以下の変数を、ビットごとの OR (``|`` 演算子) を使って組み合わせることができます。"
- # 18376c9228974d0aba5ed6fb701d9d2e
- #: ../../library/re.rst:468
- msgid "The sequence ::"
- msgstr "シーケンス ::"
- # e353dc26d6dd497587b428574b376cc9
- #: ../../library/re.rst:473
- msgid "is equivalent to ::"
- msgstr "は、 ::"
- # 0f141fdf05c64f6c9a5de07e68ecd1ee
- #: ../../library/re.rst:477
- msgid ""
- "but using :func:`re.compile` and saving the resulting regular expression "
- "object for reuse is more efficient when the expression will be used several "
- "times in a single program."
- msgstr "と等価ですが、:func:`re.compile` を使ってその結果の正規表現オブジェクトを再利用した方が、その表現を一つのプログラムで何回も使う時には効率的です。"
- # c784f92a6b8040acb051e9a3227bfc80
- #: ../../library/re.rst:483
- msgid ""
- "The compiled versions of the most recent patterns passed to "
- ":func:`re.match`, :func:`re.search` or :func:`re.compile` are cached, so "
- "programs that use only a few regular expressions at a time needn't worry "
- "about compiling regular expressions."
- msgstr "最後に :func:`re.match`、:func:`re.search`、あるいは :func:`re.compile` に渡されたパターンのコンパイルされたものがキャッシュとして残ります。そのため、正規表現を一つだけしか使わないプログラムは正規表現のコンパイルを気にする必要はありません。"
- # a23d18b1a3f5453b9cf7df63a53e5424
- #: ../../library/re.rst:492
- 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 patterns, and is ignored for byte patterns."
- msgstr "``\\w``、``\\W``、``\\b``、``\\B``、``\\d``、``\\D``、``\\s``、および ``\\S`` において、ASCII 文字のみでマッチングを行います。これは Unicode パターンでのみ意味があり、バイト列パターンでは無視されます。"
- # ff736ce7406d4572ae0e3df776133fab
- #: ../../library/re.rst:496
- msgid ""
- "Note that for backward compatibility, the :const:`re.U` flag still exists "
- "(as well as its synonym :const:`re.UNICODE` and its embedded counterpart "
- "``(?u)``), but these are redundant in Python 3 since matches are Unicode by "
- "default for strings (and Unicode matching isn't allowed for bytes)."
- msgstr "後方互換性のため、:const:`re.U` フラグ (およびそれと同義の :const:`re.UNICODE` と埋め込みで使用する ``(?u)``) はまだ存在していますが、文字列のマッチのデフォルトが Unicode になった Python 3 では冗長です (そして Unicode マッチングではバイト列は扱えません)。"
- # cb3027f7e82a4b06ab59551c16b19ccb
- #: ../../library/re.rst:505
- msgid "Display debug information about compiled expression."
- msgstr "コンパイルした表現に関するデバッグ情報を出力します。"
- # b1daeb89f106430191f24ff05f31a052
- #: ../../library/re.rst:511
- msgid ""
- "Perform case-insensitive matching; expressions like ``[A-Z]`` will match "
- "lowercase letters, too. This is not affected by the current locale and "
- "works for Unicode characters as expected."
- msgstr "英大文字・小文字を区別せずにマッチングを行います。 ``[A-Z]`` のような表現は小文字ともマッチします。これは現在のロケールの影響を受けず、Unicode 文字に対しても動作します。"
- # 2e09e67f61d24c48aa8d26d82725ca31
- #: ../../library/re.rst:519
- msgid ""
- "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` dependent on "
- "the current locale. The use of this flag is discouraged as the locale "
- "mechanism is very unreliable, and it only handles one \"culture\" at a time "
- "anyway; you should use Unicode matching instead, which is the default in "
- "Python 3 for Unicode (str) patterns."
- msgstr "``\\w``、``\\W``、``\\b``、``\\B``、``\\s``、および ``\\S`` において、ロケールに従ったマッチングを行います。ロケールのメカニズムは非常に信頼性に欠けるため、このフラグの使用は推奨されません。これはいずれにしろ、一度に一つの \"文化\" を扱うだけです。通常は Python 3 Unicode (文字列) パターンのデフォルトである、Unicode マッチングを使用してください。"
- # 3d9f9b046d384003a4cbcd0ce966e843
- #: ../../library/re.rst:529
- msgid ""
- "When specified, the pattern character ``'^'`` matches at the beginning of "
- "the string and at the beginning of each line (immediately following each "
- "newline); and the pattern character ``'$'`` matches at the end of the string"
- " and at the end of each line (immediately preceding each newline). By "
- "default, ``'^'`` matches only at the beginning of the string, and ``'$'`` "
- "only at the end of the string and immediately before the newline (if any) at"
- " the end of the string."
- msgstr "指定されると、パターン文字 ``'^'`` は、文字列の先頭および各行の先頭 (各改行の直後) とマッチします; そしてパターン文字 ``'$'`` は文字列の末尾および各行の末尾 (改行の直前) とマッチします。デフォルトでは、``'^'`` は、文字列の先頭とだけマッチし、``'$'`` は、文字列の末尾および文字列の末尾の改行の直前 (もしあれば) とマッチします。"
- # 5f0676c67ba244a5a4813983f81faa88
- #: ../../library/re.rst:540
- msgid ""
- "Make the ``'.'`` special character match any character at all, including a "
- "newline; without this flag, ``'.'`` will match anything *except* a newline."
- msgstr "特殊文字 ``'.'`` を、改行を含む任意の文字と、とにかくマッチさせます; このフラグがなければ、``'.'`` は、改行 *以外の* 任意の文字とマッチします。"
- # 57fa1f7c76904248984cc8464e472497
- #: ../../library/re.rst:547
- msgid ""
- "This flag allows you to write regular expressions that look nicer. "
- "Whitespace within the pattern is ignored, except when in a character class "
- "or preceded by an unescaped backslash, and, when a line contains a ``'#'`` "
- "neither in a character class or preceded by an unescaped backslash, all "
- "characters from the leftmost such ``'#'`` through the end of the line are "
- "ignored."
- msgstr "このフラグによって、より見やすく正規表現を書くことができます。パターン内の空白は、文字クラス内にあるかエスケープされていないバックスラッシュが前にある時以外は無視されます。また、行に、文字クラス内にもなく、エスケープされていないバックスラッシュが前にもない ``'#'`` がある時は、そのような ``'#'`` の左端からその行の末尾までが無視されます。"
- # 440ac3c6282b417db514ee9023f9b526
- #: ../../library/re.rst:553
- msgid ""
- "That means that the two following regular expression objects that match a "
- "decimal number are functionally equal::"
- msgstr "つまり、数字にマッチする下記の二つの正規表現オブジェクトは、機能的に等価です::"
- # a1373114883e4b1890cbde6ea7667b2a
- #: ../../library/re.rst:566
- msgid ""
- "Scan through *string* looking for a location where the regular expression "
- "*pattern* produces a match, and return a corresponding :ref:`match object "
- "<match-objects>`. Return ``None`` if no position in the string matches the "
- "pattern; note that this is different from finding a zero-length match at "
- "some point in the string."
- msgstr "*string* 走査して、正規表現 *pattern* がマッチを発生する位置を探し、対応する :ref:`マッチオブジェクト <match-objects>` を返します。文字列内のどこにもマッチしない場合は ``None`` を返します; これは、文字列内のある位置で長さ 0 でマッチした場合と異なることに注意して下さい。"
- # 84ea184ec8d84ada9444a0f2a5443939
- #: ../../library/re.rst:575
- msgid ""
- "If zero or more characters at the beginning of *string* match the regular "
- "expression *pattern*, return a corresponding :ref:`match object <match-"
- "objects>`. Return ``None`` if the string does not match the pattern; note "
- "that this is different from a zero-length match."
- msgstr "もし *string* の先頭で 0 個以上の文字が正規表現 *pattern* とマッチすれば、対応する :ref:`マッチオブジェクト <match-objects>` インスタンスを返します。文字列がパターンとマッチしなければ、``None`` を返します; これは長さゼロのマッチとは異なることに注意して下さい。"
- # 3fa53a487a2f4cacb5f73db533020123
- #: ../../library/re.rst:580
- msgid ""
- "Note that even in :const:`MULTILINE` mode, :func:`re.match` will only match "
- "at the beginning of the string and not at the beginning of each line."
- msgstr ":const:`MULTILINE` モードであっても、:func:`re.match` は文字列の先頭のみにマッチし、各行の先頭にはマッチしないことに注意してください。"
- # 41b28a9e8d4b43a19e481f421f356da8
- #: ../../library/re.rst:583
- msgid ""
- "If you want to locate a match anywhere in *string*, use :func:`search` "
- "instead (see also :ref:`search-vs-match`)."
- msgstr "もし *string* のマッチする位置を見つけたい場合は、:func:`search` を使って下さい (:ref:`search-vs-match` も参照してください)。"
- # 9c1ee2813ae04a79922108be82ee4003
- #: ../../library/re.rst:589
- msgid ""
- "Split *string* by the occurrences of *pattern*. If capturing parentheses "
- "are used in *pattern*, then the text of all groups in the pattern are also "
- "returned as part of the resulting list. If *maxsplit* is nonzero, at most "
- "*maxsplit* splits occur, and the remainder of the string is returned as the "
- "final element of the list. ::"
- msgstr "*string* を、*pattern* があるたびに分割します。キャプチャグループの丸括弧が *pattern* で使われていれば、パターン内のすべてのグループのテキストも結果のリストの一部として返されます。*maxsplit* がゼロでなければ、最大 *maxsplit* 個の分割が発生し、残りはリストの最終要素として返されます。::"
- # f5a7d87bde864d16b63bdca55aaf0a53
- #: ../../library/re.rst:604
- msgid ""
- "If there are capturing groups in the separator and it matches at the start "
- "of the string, the result will start with an empty string. The same holds "
- "for the end of the string:"
- msgstr "もし、キャプチャするグループが分割パターンに含まれ、それが文字列の先頭にあるならば、分割結果は、空文字列から始まります。文字列最後においても同様です:"
- # d5d2419b7bee4f8c81a4a216377d2e0b
- #: ../../library/re.rst:611
- msgid ""
- "That way, separator components are always found at the same relative indices"
- " within the result list."
- msgstr "その場合、常に、分割要素が、分割結果のリストの相対的なインデックスに現れます。"
- # 58c53b34481440d7a8b553a770dbd3cf
- #: ../../library/re.rst:614
- msgid ""
- "Note that *split* will never split a string on an empty pattern match. For "
- "example:"
- msgstr "*split* は空のパターンマッチでは、文字列を分割しないことに注意して下さい。例えば:"
- # 153d70fc831c4069b76e5f0f9bac0a64
- # 159e967d12ba4f9e917a6ba7de9c2dd5
- # 7e93d265ace345928758c3aad4f0b7de
- # 480f730ac8af4ec28a0066ebf4dae653
- # d3f92683816341b2be3521720f0803e7
- # 1d6af8ec62314d8ea03495aeedd4260d
- #: ../../library/re.rst:622 ../../library/re.rst:622 ../../library/re.rst:691
- #: ../../library/re.rst:691 ../../library/re.rst:700 ../../library/re.rst:700
- msgid "Added the optional flags argument."
- msgstr "オプションの flags 引数が追加されました。"
- # 9047782691734a359bbfd8a2b45167ef
- #: ../../library/re.rst:628
- msgid ""
- "Return all non-overlapping matches of *pattern* in *string*, as a list of "
- "strings. The *string* is scanned left-to-right, and matches are returned in"
- " the order found. If one or more groups are present in the pattern, return "
- "a list of groups; this will be a list of tuples if the pattern has more than"
- " one group. Empty matches are included in the result unless they touch the "
- "beginning of another match."
- msgstr "*pattern* の *string* へのマッチのうち、重複しないすべてのマッチを文字列のリストとして返します。*string* は左から右へと走査され、マッチは見つかった順番で返されます。パターン中に何らかのグループがある場合、グループのリストを返します。グループが複数定義されていた場合、タプルのリストになります。他のマッチの開始部分に接触しないかぎり、空のマッチも結果に含められます。"
- # 155353a5d0b249b8a0cc127fd3111c72
- #: ../../library/re.rst:638
- msgid ""
- "Return an :term:`iterator` yielding :ref:`match objects <match-objects>` "
- "over all non-overlapping matches for the RE *pattern* in *string*. The "
- "*string* is scanned left-to-right, and matches are returned in the order "
- "found. Empty matches are included in the result unless they touch the "
- "beginning of another match."
- msgstr "*string* 内の RE *pattern* の重複しないマッチの :ref:`マッチオブジェクト <match-objects>` を yield する :term:`イテレータ <iterator>` を返します。*string* は左から右へと走査され、マッチは見つかった順番で返されます。他のマッチの開始部分に接触しないかぎり、空のマッチも結果に含められます。"
- # 506aa09be0fe44918964b25ac6402328
- #: ../../library/re.rst:647
- msgid ""
- "Return the string obtained by replacing the leftmost non-overlapping "
- "occurrences of *pattern* in *string* by the replacement *repl*. If the "
- "pattern isn't found, *string* is returned unchanged. *repl* can be a string"
- " or a function; if it is a string, any backslash escapes in it are "
- "processed. That is, ``\\n`` is converted to a single newline character, "
- "``\\r`` is converted to a carriage return, and so forth. Unknown escapes "
- "such as ``\\j`` are left alone. Backreferences, such as ``\\6``, are "
- "replaced with the substring matched by group 6 in the pattern. For example:"
- msgstr "*string* 内で、重複しない *pattern* のマッチを *repl* で置き換えた文字列を返します。重複している場合はその一番左のマッチのみ置き換えられます。パターンが見つからなければ *string* を変更せずに返します。*repl* は文字列でも関数でも構いません; 文字列の場合、バックスラッシュエスケープは処理されます。すなわち、``\\n`` は単一の改行文字に変換され、``\\r`` は、キャリッジリターンに変換されます。``\\j`` のような未知のエスケープはそのままにされます。``\\6`` のような後方参照は、パターンのグループ 6 とマッチしたサブ文字列で置換されます。例えば:"
- # 9d02cc2f78ca4b798fee0246d286005a
- #: ../../library/re.rst:661
- msgid ""
- "If *repl* is a function, it is called for every non-overlapping occurrence "
- "of *pattern*. The function takes a single match object argument, and "
- "returns the replacement string. For example:"
- msgstr "もし *repl* が関数であれば、重複しない *pattern* が発生するたびにその関数が呼ばれます。この関数は一つのマッチオブジェクト引数を取り、置換文字列を返します。例えば:"
- # 1732108ef1e5425898985a0b42f8f001
- #: ../../library/re.rst:673
- msgid "The pattern may be a string or an RE object."
- msgstr "パターンは、文字列でも RE オブジェクトでも構いません。"
- # c8903e1ec2884ddf85d85641056f00c5
- #: ../../library/re.rst:675
- msgid ""
- "The optional argument *count* is the maximum number of pattern occurrences "
- "to be replaced; *count* must be a non-negative integer. If omitted or zero,"
- " all occurrences will be replaced. Empty matches for the pattern are "
- "replaced only when not adjacent to a previous match, so ``sub('x*', '-', "
- "'abc')`` returns ``'-a-b-c-'``."
- msgstr "省略可能な引数 *count* は、置換されるパターンの出現回数の最大値です; *count* は非負の整数でなければなりません。省略されるかゼロであれば、出現したものがすべて置換されます。パターンのマッチが空であれば、以前のマッチと隣合わせでない時だけ置換されますので、``sub('x*', '-', 'abc')`` は ``'-a-b-c-'`` を返します。"
- # 896ce4b9accc4ab4b14345bf6516f8e8
- #: ../../library/re.rst:681
- msgid ""
- "In string-type *repl* arguments, in addition to the character escapes and "
- "backreferences described above, ``\\g<name>`` will use the substring matched"
- " by the group named ``name``, as defined by the ``(?P<name>...)`` syntax. "
- "``\\g<number>`` uses the corresponding group number; ``\\g<2>`` is therefore"
- " equivalent to ``\\2``, but isn't ambiguous in a replacement such as "
- "``\\g<2>0``. ``\\20`` would be interpreted as a reference to group 20, not "
- "a reference to group 2 followed by the literal character ``'0'``. The "
- "backreference ``\\g<0>`` substitutes in the entire substring matched by the "
- "RE."
- msgstr ""
- # 0ec74ab940a04b7d86340982542368e7
- #: ../../library/re.rst:697
- msgid ""
- "Perform the same operation as :func:`sub`, but return a tuple ``(new_string,"
- " number_of_subs_made)``."
- msgstr ":func:`sub` と同じ操作を行いますが、タプル ``(new_string、 number_of_subs_made)`` を返します。"
- # 6fa3aff5223e4655a48a4f1c84c0d208
- #: ../../library/re.rst:706
- msgid ""
- "Escape all the characters in pattern except ASCII letters, numbers and "
- "``'_'``. This is useful if you want to match an arbitrary literal string "
- "that may have regular expression metacharacters in it."
- msgstr "パターン内の、ASCII 文字、数字、およびアンダースコアを除くすべての文字をエスケープします。これは、もしその中に正規表現のメタ文字を持つかもしれない任意のリテラル文字列とマッチしたい時に役立ちます。"
- # a04d65c4adfb41839114ff140e90d899
- # b1bb3a3f1ce4435eaf1f2095f8c7a870
- #: ../../library/re.rst:710 ../../library/re.rst:710
- msgid "The ``'_'`` character is no longer escaped."
- msgstr "``'_'`` 文字がエスケープされなくなりました。"
- # 792c07d78b294f5295a8f3d4358b135f
- #: ../../library/re.rst:716
- msgid "Clear the regular expression cache."
- msgstr "正規表現キャッシュをクリアします。"
- # 5fdf4861124c41c9a407a8e8d5c0398d
- #: ../../library/re.rst:721
- msgid ""
- "Exception raised when a string passed to one of the functions here is not a "
- "valid regular expression (for example, it might contain unmatched "
- "parentheses) or when some other error occurs during compilation or matching."
- " It is never an error if a string contains no match for a pattern."
- msgstr "ここでの関数のいずれかに渡された文字列が正しい正規表現ではない時 (例: その括弧が対になっていない)、あるいはコンパイルやマッチング中になんらかのエラーが発生した時に発生する例外です。文字列がパターンとマッチしない場合はエラーにはなりません。"
- # 86c7a84deb0f46558238a55ec6aa7664
- #: ../../library/re.rst:730
- msgid "Regular Expression Objects"
- msgstr "正規表現オブジェクト"
- # 0605574df1594c989369b9e4445ab5af
- #: ../../library/re.rst:732
- msgid ""
- "Compiled regular expression objects support the following methods and "
- "attributes:"
- msgstr "コンパイル済み正規表現オブジェクトは以下のメソッドと属性をサポートします:"
- # 97c583bc4fca4034aecee1d3bd0590e9
- #: ../../library/re.rst:737
- msgid ""
- "Scan through *string* looking for a location where this regular expression "
- "produces a match, and return a corresponding :ref:`match object <match-"
- "objects>`. Return ``None`` if no position in the string matches the "
- "pattern; note that this is different from finding a zero-length match at "
- "some point in the string."
- msgstr "*string* 走査して、この正規表現がマッチを発生する位置を探し、対応する :ref:`マッチオブジェクト <match-objects>` を返します。文字列内のどこにもマッチしない場合は ``None`` を返します; これは、文字列内のある位置で長さ 0 でマッチした場合と異なることに注意して下さい。"
- # 41c4b381322e413dbec3818286d03389
- #: ../../library/re.rst:743
- 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"
- " to slicing the string; the ``'^'`` pattern character matches at the real "
- "beginning of the string and at positions just after a newline, but not "
- "necessarily at the index where the search is to start."
- msgstr "省略可能な、2 つ目の引数 *pos* は、文字列のどこから探し始めるかを指定するインデックスで、デフォルトでは 0 です。これは、文字列をスライスしてから検索するのと、完全には等価ではありません。パターン文字 ``'^'`` は本当の文字列の先頭と、改行の直後にマッチしますが、検索を開始するインデックスがマッチするとは限りません。"
- # 0fe5441fb0e24d77a1008156edbcb0f6
- #: ../../library/re.rst:749
- 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 "
- "characters from *pos* to ``endpos - 1`` will be searched for a match. If "
- "*endpos* is less than *pos*, no match will be found; otherwise, if *rx* is a"
- " 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)`` と等価です。"
- # 7709b002686045c699afe7a7492555fa
- #: ../../library/re.rst:764
- msgid ""
- "If zero or more characters at the *beginning* of *string* match this regular"
- " expression, return a corresponding :ref:`match object <match-objects>`. "
- "Return ``None`` if the string does not match the pattern; note that this is "
- "different from a zero-length match."
- msgstr "もし *string* の *先頭の* 0 個以上の文字がこの正規表現とマッチすれば、対応する :ref:`マッチオブジェクト <match-objects>` を返します。もし文字列がパタンーとマッチしなければ、``None`` を返します。これは長さゼロのマッチとは異なることに注意して下さい。"
- # c5765fbbc22842629e1568b8164b4752
- #: ../../library/re.rst:769
- msgid ""
- "The optional *pos* and *endpos* parameters have the same meaning as for the "
- ":meth:`~regex.search` method."
- msgstr "省略可能な引数 *pos* と *endpos* 引数は、:meth:`~regex.search` メソッドと同じ意味を持ちます。"
- # bff67ddc694148d39a9ac23459bfd583
- #: ../../library/re.rst:777
- msgid ""
- "If you want to locate a match anywhere in *string*, use "
- ":meth:`~regex.search` instead (see also :ref:`search-vs-match`)."
- msgstr "*string* のどこにでもマッチさせたければ、:meth:`~regex.search` を使って下さい (:ref:`search-vs-match` も参照してください)。"
- # 9964b741115b4c2db14e3bcf43ec334e
- #: ../../library/re.rst:783
- msgid "Identical to the :func:`split` function, using the compiled pattern."
- msgstr ":func:`split` 関数と同様で、コンパイルしたパターンを使います。"
- # 1a485ecf4fbc48bb9fe19ab9644a1ae3
- #: ../../library/re.rst:788
- 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:`match`."
- msgstr ":func:`findall` 関数と同様で、コンパイルしたパターンを使います。ただし、 :meth:`match` と同じように、省略可能な *pos*、*endpos* 引数で検索範囲を指定することができます。"
- # aa00864133a94b31a7312c8b38574ff4
- #: ../../library/re.rst:795
- 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:`match`."
- msgstr ":func:`finditer` 関数と同様で、コンパイルしたパターンを使います。ただし、:meth:`match` と同じように、省略可能な *pos*、*endpos* 引数で検索範囲を指定することができます。"
- # db3875db865b4ad28f0e983024c9d8e7
- #: ../../library/re.rst:802
- msgid "Identical to the :func:`sub` function, using the compiled pattern."
- msgstr ":func:`sub` 関数と同様で、コンパイルしたパターンを使います。"
- # 7491a162e9f945b6ada0c4f2522f07d1
- #: ../../library/re.rst:807
- msgid "Identical to the :func:`subn` function, using the compiled pattern."
- msgstr ":func:`subn` 関数と同様で、コンパイルしたパターンを使います。"
- # 53278377e0b64a1c92034464d13acb30
- #: ../../library/re.rst:812
- 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 :data:`UNICODE` if the pattern is a Unicode string."
- msgstr "正規表現のマッチングフラグです。これは :func:`.compile` で指定されたフラグ、パターン内の ``(?...)`` インラインフラグ、およびパターンが Unicode 文字列だった時の :data:`UNICODE` のような暗黙のフラグとの組み合わせになりなす。"
- # 6eeac28685854986a3171b046320be66
- #: ../../library/re.rst:819
- msgid "The number of capturing groups in the pattern."
- msgstr "パターン内のキャプチャグループの数です。"
- # 5b5f84e31108455b89163b156e5edc90
- #: ../../library/re.rst:824
- msgid ""
- "A dictionary mapping any symbolic group names defined by ``(?P<id>)`` to "
- "group numbers. The dictionary is empty if no symbolic groups were used in "
- "the pattern."
- msgstr "``(?P<id>)`` で定義された任意の記号グループ名の、グループ番号への辞書マッピングです。もし記号グループがパターン内で何も使われていなければ、辞書は空です。"
- # a2f06b2931554fa3b0cf2a98932b029d
- #: ../../library/re.rst:831
- msgid "The pattern string from which the RE object was compiled."
- msgstr "RE オブジェクトがコンパイルされたパターン文字列です。"
- # c07787d579524ec7a983820526082275
- #: ../../library/re.rst:837
- msgid "Match Objects"
- msgstr "Match オブジェクト"
- # 01acef54b6214d3cb58dadf576d05f32
- #: ../../library/re.rst:839
- msgid ""
- "Match objects always have a boolean value of ``True``. Since "
- ":meth:`~regex.match` and :meth:`~regex.search` return ``None`` when there is"
- " no match, you can test whether there was a match with a simple ``if`` "
- "statement::"
- msgstr "マッチオブジェクトは常にブール値 ``True`` を持ちます。 :meth:`~regex.match` と :meth:`~regex.search` はマッチしなかった場合に ``None`` を返すので、単純な ``if`` ステートメントによってマッチしたかどうかをテストできます::"
- # 725ed8bce9734b3fb897e0689a32c5e0
- #: ../../library/re.rst:848
- msgid "Match objects support the following methods and attributes:"
- msgstr "マッチオブジェクトは以下のメソッドと属性をサポートしています:"
- # f6c2e015c1f44e16afa4ca20bc5cf7ce
- #: ../../library/re.rst:853
- msgid ""
- "Return the string obtained by doing backslash substitution on the template "
- "string *template*, as done by the :meth:`~regex.sub` method. Escapes such as"
- " ``\\n`` are converted to the appropriate characters, and numeric "
- "backreferences (``\\1``, ``\\2``) and named backreferences (``\\g<1>``, "
- "``\\g<name>``) are replaced by the contents of the corresponding group."
- msgstr "テンプレート文字列 *template* に対し、:meth:`~regex.sub` メソッドがするようなバックスラッシュ置換をして得られる文字列を返します。``\\n`` のようなエスケープは適切な文字に変換され、数値の後方参照 (``\\1``, ``\\2``) と名前付きの後方参照 (``\\g<1>``, ``\\g<name>``) は、対応するグループの内容で置き換えられます。"
- # 04e16c7c2ce5432cb8b6395b585f1cf8
- #: ../../library/re.rst:863
- 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 "
- "is a tuple with one item per argument. Without arguments, *group1* defaults "
- "to zero (the whole match is returned). If a *groupN* argument is zero, the "
- "corresponding return value is the entire matching string; if it is in the "
- "inclusive range [1..99], it is the string matching the corresponding "
- "parenthesized group. If a group number is negative or larger than the "
- "number of groups defined in the pattern, an :exc:`IndexError` exception is "
- "raised. If a group is contained in a part of the pattern that did not match,"
- " 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 "マッチした 1 個以上のサブグループを返します。引数が 1 個の場合、その結果は 1 個の文字列です。複数の引数があれば、その結果は引数ごとに項目を持つタプルになります。引数がなければ *group1* はデフォルトでゼロです (マッチしたものすべてが返されます)。もし *groupN* 引数がゼロであれば、対応する戻り値は、マッチする文字列全体になります。もしそれが範囲 [1..99] 内であれば、それは対応する丸括弧つきグループとマッチする文字列です。もしグループ番号が負であるか、あるいはパターンで定義されたグループの数より大きければ、:exc:`IndexError` 例外を送出します。グループがマッチしなかったパターンの一部に含まれていれば、対応する結果は ``None`` です。グループが、複数回マッチしたパターンの一部に含まれていれば、最後のマッチが返されます。"
- # 688ef60837e645f8891bbcdaec40c032
- #: ../../library/re.rst:885
- msgid ""
- "If the regular expression uses the ``(?P<name>...)`` 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<name>...)`` 構文を使用している場合、*groupN* 引数は、グループ名を識別する文字列であっても構いません。文字列引数がパターン内でグループ名として使用されていない場合は、:exc:`IndexError` 例外が送出されます。"
- # 40df22fc5fa048d2af1bdb325932069d
- #: ../../library/re.rst:890
- msgid "A moderately complicated example:"
- msgstr "適度に複雑な例題:"
- # e75516b3e8eb47efb4d83768c97a1ad7
- #: ../../library/re.rst:898
- msgid "Named groups can also be referred to by their index:"
- msgstr "名前の付けられたグループは、そのインデックスによっても参照できます:"
- # fd8e63a69f464ac3be11fd4e2b131a03
- #: ../../library/re.rst:905
- msgid "If a group matches multiple times, only the last match is accessible:"
- msgstr "グループが複数回マッチする場合、最後のマッチだけが利用できます:"
- # 33326c1494c243369642f9b6378ff340
- #: ../../library/re.rst:914
- 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 "パターンにマッチしたすべてのサブグループを含む、パターン内で指定されたグループ数分の要素を持つタプルを返します。引数 *default* は、マッチに加わらなかったグループ用に使われ、デフォルトでは ``None`` です。"
- # ab9db8724766474c89c7f0381ca91615
- #: ../../library/re.rst:918
- msgid "For example:"
- msgstr "例えば:"
- # d6fd913a4b3c42779a3c386b0af2319d
- #: ../../library/re.rst:924
- 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`` になります:"
- # a10fcc53cc174a10a66eb1be115fca44
- #: ../../library/re.rst:937
- 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 "マッチしたすべての *名前つき* サブグループを含む、サブグループ名でキー付けされた辞書を返します。引数 *default* はマッチに加わらなかったグループに使われ、デフォルトは ``None`` です。例えば:"
- # 44c076bda7844db8987cd5341c91e355
- #: ../../library/re.rst:949
- 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 "
- "``-1`` if *group* exists but did not contribute to the match. For a match "
- "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)`` と同じ意味ですが) は::"
- # 8718e3387a714f0a8f4ab27d237e1119
- #: ../../library/re.rst:957
- 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` 例外を送出します。"
- # 619b12e855f64570bff7eb4ab2db48f4
- #: ../../library/re.rst:962
- msgid "An example that will remove *remove_this* from email addresses:"
- msgstr "例として、電子メールのアドレスから *remove_this* を取り除く場合を示します:"
- # 4b70203942414cb8b94a8ad553e9727f
- #: ../../library/re.rst:972
- 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のタプル ``(m.start(group), m.end(group))`` を返します。もし *group* がマッチに寄与しなければ、 ``(-1, -1)`` になります。また *group* はデフォルトでゼロです。"
- # 07acbc8114b74e6dbafde8e3fd312f1e
- #: ../../library/re.rst:979
- msgid ""
- "The value of *pos* which was passed to the :meth:`~regex.search` or "
- ":meth:`~regex.match` method of a :ref:`regex object <re-objects>`. This is "
- "the index into the string at which the RE engine started looking for a "
- "match."
- msgstr ":ref:`正規表現オブジェクト <re-objects>` の :meth:`~regex.search` か :meth:`~regex.match` に渡された *pos* の値です。これは RE エンジンがマッチを探し始める位置の文字列のインデックスです。"
- # 143ee57db74640abae5acaa04751e100
- #: ../../library/re.rst:986
- msgid ""
- "The value of *endpos* which was passed to the :meth:`~regex.search` or "
- ":meth:`~regex.match` method of a :ref:`regex object <re-objects>`. This is "
- "the index into the string beyond which the RE engine will not go."
- msgstr ":ref:`正規表現オブジェクト <re-objects>` の :meth:`~regex.search` か :meth:`~regex.match` に渡された *endpos* の値です。これは RE エンジンがそれ以上は進まない位置の文字列のインデックスです。"
- # b24410b57bc34d26a9db15b5fad2a535
- #: ../../library/re.rst:993
- 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)(b))``, and ``((ab))`` will have ``lastindex == 1`` if applied to the "
- "string ``'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`` となります。"
- # 33ee428783d4428595593686eaec7c43
- #: ../../library/re.rst:1002
- 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`` です。"
- # 29bd554561d747be9973ea5d659745e0
- #: ../../library/re.rst:1008
- msgid ""
- "The regular expression object whose :meth:`~regex.match` or "
- ":meth:`~regex.search` method produced this match instance."
- msgstr "このマッチインスタンスを :meth:`~regex.match` あるいは :meth:`~regex.search` メソッドで生成した正規表現オブジェクトです。"
- # f8920d8297ae4dc69f102c34c4827b75
- #: ../../library/re.rst:1014
- msgid "The string passed to :meth:`~regex.match` or :meth:`~regex.search`."
- msgstr ":meth:`~regex.match` または :meth:`~regex.search` へ渡された文字列です。"
- # d6986ef95d2647ea94fee70909a8931f
- #: ../../library/re.rst:1020
- msgid "Regular Expression Examples"
- msgstr "正規表現の例"
- # 7cd1126d1f7246ce83315e9766957f40
- #: ../../library/re.rst:1024
- msgid "Checking for a Pair"
- msgstr "ペアの確認"
- # 63a907b7144e4b3187b54f96afd8266b
- #: ../../library/re.rst:1026
- msgid ""
- "In this example, we'll use the following helper function to display match "
- "objects a little more gracefully:"
- msgstr "この例では、マッチオブジェクトの表示を少し美しくするために、以下の補助関数を使用します:"
- # e8c0fef3b05d40b6bb7a5dcdd8c4453e
- #: ../../library/re.rst:1036
- msgid ""
- "Suppose you are writing a poker program where a player's hand is represented"
- " as a 5-character string with each character representing a card, \"a\" for "
- "ace, \"k\" for king, \"q\" for queen, \"j\" for jack, \"t\" for 10, and "
- "\"2\" through \"9\" representing the card with that value."
- msgstr "あなたはポーカープログラムを書いているとします。プレイヤーの持ち札はそれぞれの文字が 1 枚のカードを意味する 5 文字の文字列で表現されます。\"a\" はエース、\"k\" はキング、\"q\" はクイーン、\"j\" はジャック \"0\" は10、そして \"2\" から \"9\" はそれぞれの数字のカードを表します。"
- # 8ee3d4b104234e73870fa3fcaf137a38
- #: ../../library/re.rst:1041
- msgid "To see if a given string is a valid hand, one could do the following:"
- msgstr "与えられた文字列が持ち札として有効かどうかの確認は、下記のようにして行えます:"
- # a74967cb43bf45449f92a0bdf0eb77d5
- #: ../../library/re.rst:1051
- 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\"`` は、ペアを含んでいます。言い換えると同じ値のカードが 2 枚あります。これを正規表現にマッチさせるには、後方参照を使います:"
- # d400fdbf97644278bb40644d24ae8a12
- #: ../../library/re.rst:1061
- 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 "どのカードのペアになっているかを調べるには、以下のようにマッチオブジェクトの :meth:`~match.group` メソッドを使います:"
- # 99c8e0d1fb344bb78cdfb5f9522af77c
- #: ../../library/re.rst:1081
- msgid "Simulating scanf()"
- msgstr "scanf() をシミュレートする"
- # d55783e7b36343deba88832304154d92
- #: ../../library/re.rst:1085
- msgid ""
- "Python does not currently have an equivalent to :c:func:`scanf`. Regular "
- "expressions are generally more powerful, though also more verbose, than "
- ":c:func:`scanf` format strings. The table below offers some more-or-less "
- "equivalent mappings between :c:func:`scanf` format tokens and regular "
- "expressions."
- msgstr "Python には現在のところ、:c:func:`scanf` に相当するものがありません。正規表現は、:c:func:`scanf` のフォーマット文字列よりも一般により強力であり、また冗長でもあります。以下の表に :c:func:`scanf` のフォーマットトークンにほぼ等価に対応する正規表現を示します。"
- # 6ad47dd21a5b435682c9c7a55c321882
- #: ../../library/re.rst:1092
- msgid ":c:func:`scanf` Token"
- msgstr ":c:func:`scanf` トークン"
- # 62bee99f73f04c5c9b396693f9bfe1c2
- #: ../../library/re.rst:1092
- msgid "Regular Expression"
- msgstr "正規表現"
- # 14ad0a1fe72e401d858faa62fee59509
- #: ../../library/re.rst:1094
- msgid "``%c``"
- msgstr "``%c``"
- # 66e48ff722fa4c10a05f8de22cdc32bc
- #: ../../library/re.rst:1094
- msgid "``.``"
- msgstr "``.``"
- # 4f7ee89aacb24c24b55d2ef510862442
- #: ../../library/re.rst:1096
- msgid "``%5c``"
- msgstr "``%5c``"
- # a363ee0e21b14aa9994af5fcffb7fa23
- #: ../../library/re.rst:1096
- msgid "``.{5}``"
- msgstr "``.{5}``"
- # bd7f6dfcfd4244ea8dde282ed6dc44c3
- #: ../../library/re.rst:1098
- msgid "``%d``"
- msgstr "``%d``"
- # d7097972243a4c8f8d2c57b65a7ed9c3
- #: ../../library/re.rst:1098
- msgid "``[-+]?\\d+``"
- msgstr "``[-+]?\\d+``"
- # 3f7f92cd1f0d4fae8cba3f9b653e3a87
- #: ../../library/re.rst:1100
- msgid "``%e``, ``%E``, ``%f``, ``%g``"
- msgstr "``%e``, ``%E``, ``%f``, ``%g``"
- # 7e038b1cf27d473c88f80a68f7345ea5
- #: ../../library/re.rst:1100
- msgid "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"
- msgstr "``[-+]?(\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?``"
- # e05bc847d5784728add5fe4f8997d8c5
- #: ../../library/re.rst:1102
- msgid "``%i``"
- msgstr "``%i``"
- # 02bd10d67e864036a6769c3b3de73a1e
- #: ../../library/re.rst:1102
- msgid "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"
- msgstr "``[-+]?(0[xX][\\dA-Fa-f]+|0[0-7]*|\\d+)``"
- # 906e4908b1954801bfce51e0f4464eac
- #: ../../library/re.rst:1104
- msgid "``%o``"
- msgstr "``%o``"
- # d900d23167494dc8bf976fafe19692f7
- #: ../../library/re.rst:1104
- msgid "``[-+]?[0-7]+``"
- msgstr "``[-+]?[0-7]+``"
- # 7d6089f691b146b094e67c16fd99de88
- #: ../../library/re.rst:1106
- msgid "``%s``"
- msgstr "``%s``"
- # 2804a234a9294f24a95b8bcca9d01d14
- #: ../../library/re.rst:1106
- msgid "``\\S+``"
- msgstr "``\\S+``"
- # 8cc6b4113e524c9e92fd516b3bdc4caf
- #: ../../library/re.rst:1108
- msgid "``%u``"
- msgstr "``%u``"
- # 6e08c99b64e14c20bb5c1cbd5306e1e3
- #: ../../library/re.rst:1108
- msgid "``\\d+``"
- msgstr "``\\d+``"
- # 73d29d27e89b4b4f81d37315f1716955
- #: ../../library/re.rst:1110
- msgid "``%x``, ``%X``"
- msgstr "``%x``, ``%X``"
- # 89ba21ffe3184489a670330d617fd80c
- #: ../../library/re.rst:1110
- msgid "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
- msgstr "``[-+]?(0[xX])?[\\dA-Fa-f]+``"
- # b59fcd56493c4b83aae5dc0faeb4d770
- #: ../../library/re.rst:1113
- msgid "To extract the filename and numbers from a string like ::"
- msgstr "以下のような文字列からファイル名と数値を抽出するには ::"
- # c4433fc882614511bf33ec3920376562
- #: ../../library/re.rst:1117
- msgid "you would use a :c:func:`scanf` format like ::"
- msgstr "このように :c:func:`scanf` フォーマットを使うでしょう ::"
- # 90c5ee58ad22465696b7b228058f4bc3
- #: ../../library/re.rst:1121
- msgid "The equivalent regular expression would be ::"
- msgstr "それと等価な正規表現は以下のとおりです ::"
- # 010ab8c9c2484c2383eb1e827bbc3810
- #: ../../library/re.rst:1129
- msgid "search() vs. match()"
- msgstr "search() vs. match()"
- # 955779cd202b43f5b1c3c27ad1672ef3
- #: ../../library/re.rst:1133
- msgid ""
- "Python offers two different primitive operations based on regular "
- "expressions: :func:`re.match` checks for a match only at the beginning of "
- "the string, while :func:`re.search` checks for a match anywhere in the "
- "string (this is what Perl does by default)."
- msgstr "Python は正規表現ベースの 2 個の基本的な関数、文字列の先頭でのみのマッチを確認する :func:`re.match` および、文字列内の位置にかかわらずマッチを確認する :func:`re.search` (Perl でのデフォルトの挙動) を提供しています。"
- # c5b6b43122074233ab53630e004a15e9
- #: ../../library/re.rst:1138
- msgid "For example::"
- msgstr "です。例えば、以下のように設定します::"
- # fb976872f835423eaa8739be79f288f5
- #: ../../library/re.rst:1144
- msgid ""
- "Regular expressions beginning with ``'^'`` can be used with :func:`search` "
- "to restrict the match at the beginning of the string::"
- msgstr "``'^'`` で始まる正規表現は、:func:`search` において、マッチを文字列の先頭からに制限するために使用します::"
- # 5d2cca09e4f14976bf1ec9994dccb165
- #: ../../library/re.rst:1152
- 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` では各行の先頭にもマッチします。"
- # b280bc6684c04d2b87a539031062e59a
- #: ../../library/re.rst:1162
- msgid "Making a Phonebook"
- msgstr "電話帳の作成"
- # 63cb87c7fbb24cb1bceb2192601503fa
- #: ../../library/re.rst:1164
- 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 で編集したりしやすくする際に、非常に役に立ちます。"
- # 5245354d118248a3b011534f0428570f
- #: ../../library/re.rst:1169
- msgid ""
- "First, here is the input. Normally it may come from a file, here we are "
- "using triple-quoted string syntax:"
- msgstr "最初に、入力を示します。通常、これはファイルからの入力になるでしょう。ここでは、3 重引用符の書式とします:"
- # 49923b0cd51b4109bec7a4106c2840f8
- #: ../../library/re.rst:1180
- 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 "個々の記録は、1 つ以上の改行で区切られています。まずは、文字列から空行を除き、記録ごとのリストに変換します:"
- # 30d65de2fa914f0497bf6a6d103911e7
- #: ../../library/re.rst:1193
- 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`` 引数を使います:"
- # d07ee7ef210b4ef2b0a157aa2bdaba91
- #: ../../library/re.rst:1206
- 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`` にすれば、ハウスナンバーと、ストリート名を分割することができます:"
- # bbc735bd4c514bc3bfcfd1fb606adb1d
- #: ../../library/re.rst:1221
- msgid "Text Munging"
- msgstr "テキストの秘匿"
- # d0e0c120464a42ceaaaba3e36cedd679
- #: ../../library/re.rst:1223
- 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` はパターンにマッチした部分を文字列や関数の戻り値で置き換えます。この例では、\"秘匿\" する文字列に、関数と共に :func:`sub` を適用する例を示します。言い換えると、最初と最後の文字を除く、単語中の文字の位置をランダム化します::"
- # b0e12683b05645d0ad36af86ce685292
- #: ../../library/re.rst:1240
- msgid "Finding all Adverbs"
- msgstr "すべての形容動詞を見つける"
- # c57a76e6a763499187ba5baf5741a2a0
- #: ../../library/re.rst:1242
- msgid ""
- ":func:`findall` matches *all* occurrences of a pattern, not just the first "
- "one as :func:`search` does. For example, if one was a writer and wanted to "
- "find all of the adverbs in some text, he or she might use :func:`findall` in"
- " the following manner:"
- msgstr ":func:`findall` はパターンにマッチする *すべてに* マッチします。:func:`search` がそうであるように、最初のものだけに、ではありません。例えば、なにかの文章のすべての副詞を見つけたいとき、下記のように :func:`findall` を使います:"
- # 5320298cdb964cc884910cabacaac021
- #: ../../library/re.rst:1253
- msgid "Finding all Adverbs and their Positions"
- msgstr "すべての形容動詞と、その位置を見つける"
- # a5589879b0e34dbda2c19497a85dfd65
- #: ../../library/re.rst:1255
- msgid ""
- "If one wants more information about all matches of a pattern than the "
- "matched text, :func:`finditer` is useful as it provides :ref:`match objects "
- "<match-objects>` instead of strings. Continuing with the previous example, "
- "if one was a writer who wanted to find all of the adverbs *and their "
- "positions* in some text, he or she would use :func:`finditer` in the "
- "following manner:"
- msgstr "もし、パターンにマッチするものについて、マッチしたテキスト以上の情報を得たいと考えた時、文字列ではなく :ref:`マッチオブジェクト <match-objects>` を返す :func:`finditer` が便利です。以下に例を示すように、なにかの文章のすべての副詞と、*その位置を* 調べたい時、以下のように :func:`finditer` を使います:"
- # 71e52bbb77b74e41805de6d40cfefc9a
- #: ../../library/re.rst:1269
- msgid "Raw String Notation"
- msgstr "Raw 文字列記法"
- # 9fa54de623484941a056bb50718810a8
- #: ../../library/re.rst:1271
- msgid ""
- "Raw string notation (``r\"text\"``) keeps regular expressions sane. Without"
- " it, every backslash (``'\\'``) in a regular expression would have to be "
- "prefixed with another one to escape it. For example, the two following "
- "lines of code are functionally identical:"
- msgstr "Raw 文字列記法 (``r\"text\"``) により、バックスラッシュ (``'\\'``) を個々にバックスラッシュでエスケープすることなしに、正規表現を正常な状態に保つことができます。例えば、以下の 2 つのコードは機能的に等価です:"
- # 098787007e964a60a1f82aa838863b4b
- #: ../../library/re.rst:1281
- 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 "文字通りのバックスラッシュにマッチさせたいなら、正規表現中ではエスケープする必要があります。Raw 文字列記法では、``r\"\\\\\"`` になります。Raw 文字列記法を用いない場合、``\"\\\\\\\\\"`` としなくてはなりません。以下のコードは機能的に等価です:"
- # 6f616fe8bbf848bea15a37625f906d39
- #: ../../library/re.rst:1293
- msgid "Writing a Tokenizer"
- msgstr "トークナイザを書く"
- # 80bda42390b6493187b76c6cf20a926d
- #: ../../library/re.rst:1295
- msgid ""
- "A `tokenizer or scanner <http://en.wikipedia.org/wiki/Lexical_analysis>`_ "
- "analyzes a string to categorize groups of characters. This is a useful "
- "first step in writing a compiler or interpreter."
- msgstr "`トークナイザやスキャナ <http://ja.wikipedia.org/wiki/%E5%AD%97%E5%8F%A5%E8%A7%A3%E6%9E%90>`_ は文字列を解析し、文字のグループにカテゴリ分けします。これはコンパイラやインタプリタを作成する最初の一歩として役立ちます。"
- # 0081b942c09f4569913daee976754e3a
- #: ../../library/re.rst:1299
- 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 "テキストのカテゴリは正規表現で指定されます。技術的には、それらを一つのマスター正規表現に結合し、連続したマッチをループさせます::"
- # 29790428517c4c6d9806c62f9f34e2ae
- #: ../../library/re.rst:1349
- msgid "The tokenizer produces the following output::"
- msgstr "トークナイザは以下の出力を作成します::"
- # 41a3b4c69d434eaa85cc03257fd72696
- #: ../../library/re.rst:1083
- msgid "scanf()"
- msgstr "scanf()"