argra****@users*****
argra****@users*****
2017年 9月 18日 (月) 02:33:10 JST
Index: docs/perl/5.14.1/perlrecharclass.pod diff -u docs/perl/5.14.1/perlrecharclass.pod:1.2 docs/perl/5.14.1/perlrecharclass.pod:1.3 --- docs/perl/5.14.1/perlrecharclass.pod:1.2 Tue Feb 7 03:29:10 2017 +++ docs/perl/5.14.1/perlrecharclass.pod Mon Sep 18 02:33:10 2017 @@ -376,8 +376,10 @@ =end original -C<\w> matches the same as C<\p{Word}> matches in this range. That is, -it matches Thai letters, Greek letters, etc. This includes connector +C<\w> はこの範囲で C<\p{Word}> がマッチングするものと同じものに +マッチングします。 +つまり、タイ文字、ギリシャ文字などです。 +This includes connector punctuation (like the underscore) which connect two words together, or diacritics, such as a C<COMBINING TILDE> and the modifier letters, which are generally used to add auxiliary markings to letters. @@ -400,9 +402,8 @@ =end original -C<\w> matches the platform's native underscore character plus whatever -the locale considers to be alphanumeric. -(TBT) +C<\w> は、プラットフォームのネイティブな下線に加えてロケールが英数字と +考えるものにマッチングします。 =item if Unicode rules are in effect or if on an EBCDIC platform ... @@ -450,10 +451,8 @@ =end original -There are a number of security issues with the full Unicode list of word -characters. +完全な Unicode の単語文字の一覧には多くのセキュリティ問題があります。 L<http://unicode.org/reports/tr36> を参照してください。 -(TBT) =begin original @@ -494,6 +493,8 @@ =item If the C</a> modifier is in effect ... +(C</a> 修飾子が有効なら ...) + =begin original C<\s> matches the 5 characters [\t\n\f\r ]; that is, the horizontal tab, @@ -502,17 +503,21 @@ =end original -C<\s> matches the 5 characters [\t\n\f\r ]; that is, the horizontal tab, -the newline, the form feed, the carriage return, and the space. (Note -that it doesn't match the vertical tab, C<\cK> on ASCII platforms.) -(TBT) +C<\s> は [\t\n\f\r ] の 5 文字にマッチングします; つまり、水平タブ、 +改行、改頁、復帰、スペースです。 +(ASCII プラットフォームでは C<\cK> である垂直タブには +マッチングしないことに注意してください。) =item otherwise ... +(さもなければ ...) + =over =item For code points above 255 ... +(256 以上の符号位置では ...) + =begin original C<\s> matches exactly the code points above 255 shown with an "s" column @@ -526,10 +531,14 @@ =item For code points below 256 ... +(255 以下の符号位置では ...) + =over =item if locale rules are in effect ... +(ロケール規則が有効なら ...) + =begin original C<\s> matches whatever the locale considers to be whitespace. Note that @@ -538,10 +547,9 @@ =end original -C<\s> matches whatever the locale considers to be whitespace. Note that -this is likely to include the vertical space, unlike non-locale C<\s> -matching. -(TBT) +C<\s> はロケールが空白だと考えるものにマッチングします。 +これは非ロケールの C<\s> と異なりおそらく垂直スペースを含むことに +注意してください。 =item if Unicode rules are in effect or if on an EBCDIC platform ... @@ -552,9 +560,7 @@ =end original -C<\s> matches exactly the characters shown with an "s" column in the -table below. -(TBT) +C<\s> は正確に以下の表で "s" の列にある文字にマッチングします。 =item otherwise ... @@ -565,9 +571,8 @@ =end original -C<\s> matches [\t\n\f\r ]. -Note that this list doesn't include the non-breaking space. -(TBT) +C<\s> は [\t\n\f\r ] にマッチングします。 +この一覧にはノーブレークスペースが含まれていないことに注意してください。 =back @@ -751,18 +756,18 @@ これは、ドットのように、改行以外の任意の文字にマッチングします。 違いは、C<\N> は I<単一行> 正規表現修飾子の影響を受けないことです (上述の L</The dot> 参照)。 -Note -that the form C<\N{...}> may mean something completely different. When the -C<{...}> is a L<quantifier|perlre/Quantifiers>, it means to match a non-newline -character that many times. +C<\N{...}> 型式は何か全く違うものを意味するかも知れないことに +注意してください。 +C<{...}> が L<量指定子|perlre/Quantifiers> なら、これは指定された回数の +非改行文字にマッチングします。 例えば、C<\N{3}> は三つの非改行にマッチングします; C<\N{5,}> は五つ以上の非改行にマッチングします。 -But if C<{...}> -is not a legal quantifier, it is presumed to be a named character. See -L<charnames> for those. For example, none of C<\N{COLON}>, C<\N{4F}>, and -C<\N{F4}> contain legal quantifiers, so Perl will try to find characters whose -names are respectively C<COLON>, C<4F>, and C<F4>. -(TBT) +しかし、C<{...}> が有効な量指定子でない場合、これは名前付き文字と +推定されます。 +これについては L<charnames> を参照してください。 +例えば、C<\N{COLON}>, C<\N{4F}>, C<\N{F4}> はどれも有効な +量指定子ではないので、Perl はそれぞれ C<COLON>, C<4F>, C<F4> という名前の +文字を探そうとします。 =head3 Unicode Properties @@ -814,10 +819,8 @@ =end original -If neither the C</a> modifier nor locale rules are in effect, the use of -a Unicode property will force the regular expression into using Unicode -rules. -(TBT) +C</a> 修飾子もロケール規則も有効でない場合、Unicode 特性を使うと +正規表現に Unicode 規則を使うように強制します。 =begin original Index: docs/perl/5.14.1/perlre.pod diff -u docs/perl/5.14.1/perlre.pod:1.8 docs/perl/5.14.1/perlre.pod:1.9 --- docs/perl/5.14.1/perlre.pod:1.8 Tue Feb 7 03:29:10 2017 +++ docs/perl/5.14.1/perlre.pod Mon Sep 18 02:33:10 2017 @@ -333,31 +333,34 @@ C</x> は、バックスラッシュでエスケープされたり文字クラスの中だったりしない ほとんどの空白を無視するように正規表現パーサに伝えます。 -You can use this to break up -your regular expression into (slightly) more readable parts. The C<#> -character is also treated as a metacharacter introducing a comment, -just as in ordinary Perl code. This also means that if you want real -whitespace or C<#> characters in the pattern (outside a character -class, where they are unaffected by C</x>), then you'll either have to -escape them (using backslashes or C<\Q...\E>) or encode them using octal, -hex, or C<\N{}> escapes. Taken together, these features go a long way towards -making Perl's regular expressions more readable. Note that you have to -be careful not to include the pattern delimiter in the comment--perl has -no way of knowing you did not intend to close the pattern early. See -the C-comment deletion code in L<perlop>. Also note that anything inside -a C<\Q...\E> stays unaffected by C</x>. And note that C</x> doesn't affect -space interpretation within a single multi-character construct. For -example in C<\x{...}>, regardless of the C</x> modifier, there can be no -spaces. Same for a L<quantifier|/Quantifiers> such as C<{3}> or -C<{5,}>. Similarly, C<(?:...)> can't have a space between the C<?> and C<:>, -but can between the C<(> and C<?>. Within any delimiters for such a -construct, allowed spaces are not affected by C</x>, and depend on the -construct. For example, C<\x{...}> can't have spaces because hexadecimal -numbers don't have spaces in them. But, Unicode properties can have spaces, so -in C<\p{...}> there can be spaces that follow the Unicode rules, for which see -L<perluniprops/Properties accessible through \p{} and \P{}>. +これは正規表現を(少し)読みやすく部分に分割するために使えます。 +また、C<#> は通常の Perl コードと同様コメントを開始するメタ文字として +扱われます。 +これはまた、(C</x> の影響を受けない文字クラス内以外で)パターン中に本当の空白や +C<#> 文字を使いたい場合は、(逆スラッシュや C<\Q...\E> を使って) +エスケープするか、8 進数、16 進数、C<\N{}> エスケープのいずれかで +エンコードする必要があると言うことです。 +まとめると、これらの機能は Perl の正規表現をより読みやすくするために +大きく役立ちます。 +コメントにパターン区切りを含まないように注意する必要があります--perl は +早くパターンを終了したいわけではないと言うことを知る手段がありません。 +L<perlop> の C 型式のコメントを削除するコードを参照してください。 +また、C<\Q...\E> の内側のものは C</x> の影響を受けないことにも +注意してください。 +例えば、C<\x{...}> の内部では、C</x> 修飾子に関わらず、スペースを +含むことはできません。 +C<{3}> や C<{5,}> のような L<量指定子|/Quantifiers> も同様です。 +また、C<(?:...)> も C<?> と C<:> の間にスペースを含むことはできませんが、 +C<(> と C<?> の間には含むことができます。 +このような構文の区切り文字の中では、スペースが許されるかどうかは +C</x> に影響されず、構文自身に影響されます。 +例えば、16 進数はスペースを含むことができないので C<\x{...}> はスペースを +含むことができません。 +しかし、Unicode 特性はスペースを含むことができるので、 +C<\p{...}> は Unicode の規則に従ってスペースを含むことができます; +L<perluniprops/Properties accessible through \p{} and \P{}> を +参照してください。 X</x> -(TBT) =head3 Character set modifiers @@ -384,12 +387,11 @@ =end original -At any given time, exactly one of these modifiers is in effect. Once -compiled, the behavior doesn't change regardless of what rules are in -effect when the regular expression is executed. And if a regular -expression is interpolated into a larger one, the original's rules -continue to apply to it, and only it. -(TBT) +任意のある瞬間において、これらの修飾子の内正確に一つだけが有効になります。 +一旦コンパイルされると、正規表現が実行されるときにどの規則が有効化に関わらず、 +振る舞いは変更されません。 +そして正規表現がより大きな正規表現に展開された場合、元の規則だけが +適用され続けます。 =begin original @@ -398,9 +400,9 @@ =end original -Note that the modifiers affect only pattern matching, and do not extend -to any replacement done. For example, -(TBT) +修飾子はパターンマッチングに対してのみ影響を与え、置換には拡張されないことに +注意してください。 +例えば: s/foo/\Ubar/l @@ -413,11 +415,11 @@ =end original -will uppercase "bar", but the C</l> does not affect how the C<\U> -operates. If C<use locale> is in effect, the C<\U> will use locale -rules; if C<use feature 'unicode_strings'> is in effect, it will -use Unicode rules, etc. -(TBT) +これは大文字の "bar" にしますが、C</l> は C<\U> がどう処理を行うかに +影響を与えません。 +C<use locale> が有効の場合は C<\U> はロケールの規則を使い、 +C<use feature 'unicode_strings'> が有効の場合は Unicode の規則を使い、 +以下同様です。 =head4 /l @@ -589,11 +591,10 @@ =end original -This modifier may be specified to be the default by C<use feature -'unicode_strings>, but see -L</Which character set modifier is in effect?>. +この修飾子は C<use feature 'unicode_strings> によってデフォルトに +設定されますが、L</Which character set modifier is in effect?> を +参照してください。 X</u> -(TBT) =head4 /a @@ -678,9 +679,8 @@ =end original -To forbid ASCII/non-ASCII matches (like "k" with C<\N{KELVIN SIGN}>), -specify the "a" twice, for example C</aai> or C</aia> -(TBT) +("k" と C<\N{KELVIN SIGN}> のような) ASCII/非-ASCII マッチングを禁止するには、 +C</aai> や C</aia> のように "a" を 2 回指定します。 =begin original @@ -690,10 +690,9 @@ =end original -To reiterate, this modifier provides protection for applications that -don't wish to be exposed to all of Unicode. Specifying it twice -gives added protection. -(TBT) +繰り返すと、この修飾子は全ての Unicode に対して曝されることを望んでいない +アプリケーションに対する保護を提供します。 +2 回指定することで追加の保護を提供します。 =begin original @@ -705,12 +704,11 @@ =end original -This modifier may be specified to be the default by C<use re '/a'> -or C<use re '/aa'>, but see -L</Which character set modifier is in effect?>. +この修飾子は C<use re '/a'> または C<use re '/aa'> でデフォルトに +設定されますが、L</Which character set modifier is in effect?> を +参照してください。 X</a> X</aa> -(TBT) =head4 /d @@ -1661,13 +1659,11 @@ =end original -Capture group contents are dynamically scoped and available to you outside the -pattern until the end of the enclosing block or until the next successful -match, whichever comes first. +捕捉グループの内容は動的スコープを持ち、パターンの外側でも現在のブロックの +末尾か次のマッチングの成功のどちらか早いほうまで利用可能です。 (L<perlsyn/"Compound Statements"> を参照してください。) -You can refer to them by absolute number (using C<"$1"> instead of C<"\g1">, -etc); or by name via the C<%+> hash, using C<"$+{I<name>}">. -(TBT) +これらに対して (C<"\g1"> などの代わりに C<"$1"> を使って) 絶対値で +参照するか、C<"$+{I<name>}"> を使って C<%+> 経由で名前で参照できます。 =begin original