argra****@users*****
argra****@users*****
2009年 2月 18日 (水) 00:56:03 JST
Index: docs/perl/5.10.0/perlretut.pod diff -u docs/perl/5.10.0/perlretut.pod:1.7 docs/perl/5.10.0/perlretut.pod:1.8 --- docs/perl/5.10.0/perlretut.pod:1.7 Wed Jan 28 20:46:34 2009 +++ docs/perl/5.10.0/perlretut.pod Wed Feb 18 00:56:03 2009 @@ -1930,10 +1930,8 @@ 後方参照で正しい番号を得るために開きかっこを数えるということは、捕捉 グループが複数になるとすぐに間違いを起こしがちになります。 より便利なテクニックである相対後方参照が Perl 5.10 で利用可能です。 -To refer to the immediately -preceding capture group one now may write C<\g{-1}>, the next but -last is available via C<\g{-2}>, and so on. -(TBT) +直前の捕捉グループを参照するためには C<\g{-1}> と書き、その手前は +C<\g{-2}>、などとなります。 =begin original @@ -2048,7 +2046,7 @@ =head2 Alternative capture group numbering -(代替捕捉グループ番号付け) +(選択捕捉グループ番号付け) =begin original @@ -2058,10 +2056,9 @@ =end original -Yet another capturing group numbering technique (also as from Perl 5.10) -deals with the problem of referring to groups within a set of alternatives. +もう一つのグループの番号付けの技術 (これも Perl 5.10 からです) は、 +選択の集合の中にあるグループを参照する問題を扱います。 民間形式と軍形式の時刻にマッチングするパターンを考えます: -(TBT) if ( $time =~ /(\d\d|\d):(\d\d)|(\d\d)(\d\d)/ ){ # process hour and minute @@ -2098,10 +2095,10 @@ =end original -Within the alternative numbering group, buffer numbers start at the same -position for each alternative. After the group, numbering continues -with one higher than the maximum reached across all the alternatives. -(TBT) +選択番号付けグループの中で、バッファ番号はそれぞれの選択に対して +同じ位置から始まります。 +このグループの後、番号付けは全ての選択の中での最大値に 1 を加えた値から +続行します。 =head2 Position information @@ -3019,7 +3016,7 @@ =head2 Possessive quantifiers -(所有格量指定子) +(絶対最大量指定子) =begin original @@ -3067,14 +3064,12 @@ =end original -Perl 5.10 での I<所有格量指定子> の導入によって、 -we -have a way of instructing the regex engine not to backtrack, with the -usual quantifiers with a C<+> appended to them. This makes them greedy as -well as stingy; once they succeed they won't give anything back to permit -another solution. +Perl 5.10 での I<絶対最大量指定子> の導入によって、 +普通の量指定子に C<+> を追加することで、正規表現エンジンに +バックトラックしないように指示することができるようになります。 +これは貪欲であるのと同様出し惜しみをするようにします; 一旦マッチングすると、 +他の解決策のために手放すということをしなくなります。 これらは以下のような意味があります: -(TBT) =over 4 @@ -3089,9 +3084,8 @@ =end original C<a{n,m}+> は: 最小で C<n> 回、最大で C<m> 回の間で出来るだけたくさん -マッチングし、and don't give anything up. C<a?+> is short -for C<a{0,1}+> -(TBT) +マッチングし、そして何も手放しません。 +C<a?+> は C<a{0,1}+> の省略形です。 =item * @@ -3104,9 +3098,8 @@ =end original C<a{n,}+> は: 最小で C<n> 回で出来るだけたくさんマッチングし、 -and don't give anything up. C<a*+> is short for C<a{0,}+> and C<a++> is -short for C<a{1,}+>. -(TBT) +そして何も手放しません。 +C<a*+> は C<a{0,}+> の省略形で、C<a++> は C<a{1,}+> の省略形です。 =item * @@ -3129,7 +3122,7 @@ =end original -これらの所有格量指定子は、以下で述べる、より一般的な概念である +これらの絶対最大量指定子は、以下で述べる、より一般的な概念である I<独立部分式> の特殊な場合を表現しています。 =begin original @@ -5526,15 +5519,12 @@ これは対応する後方参照 C<\integer> が先行する正規表現の部分の中で マッチしていれば真となります。 同じことは、捕捉バッファに結び付けられた名前を使って、 -C<< (<name>) >> or C<< ('name') >> のように書くことでもできます。 +C<< (<name>) >> や C<< ('name') >> のように書くことでもできます。 二番目の形式はゼロ幅の表明 C<(?...)> で、先読み、戻り読み、もしくは コード表明 (code assertion 次のセクションで説明します)のいずれかです。 -The third set of forms -provides tests that return true if the expression is executed within -a recursion (C<(R)>) or is being called from some capturing group, -referenced either by number (C<(R1)>, C<(R2)>,...) or by name -(C<(R&name)>). -(TBT) +3番目の形式は、もし式が再帰 (C<(R)>) の中で実行されるか、 +数値 (C<(R1)>, C<(R2)>,...) か名前 (C<(R&name)>) で参照される捕捉グループから +呼び出されていると真を返すというテストを提供します。 =begin original @@ -5608,8 +5598,9 @@ Some regular expressions use identical subpatterns in several places. Starting with Perl 5.10, it is possible to define named subpatterns in a section of the pattern so that they can be called up by name -anywhere in the pattern. This syntactic pattern for this definition -group is C<< (?(DEFINE)(?<name>pattern)...) >>. +anywhere in the pattern. +この定義グループのためのパターン文法は +C<< (?(DEFINE)(?<name>pattern)...) >> です。 名前付きパターンの挿入は C<(?&name)> のように書きます。 (TBT) @@ -6378,9 +6369,9 @@ =end original パターンは文字のサブセットにマッチするクラスで始まります。 -Whenever -this matches, a statement like C<$count{'a'}++;> is executed, incrementing -the letter's counter. Then C<(*FAIL)> does what it says, and +これがマッチングするときはいつでも、C<$count{'a'}++;> のような文が実行され、 +文字のカウンタをインクリメントします。 +Then C<(*FAIL)> does what it says, and the regexp engine proceeds according to the book: as long as the end of the string hasn't been reached, the position is advanced before looking for another vowel. Index: docs/perl/5.10.0/perlunicode.pod diff -u docs/perl/5.10.0/perlunicode.pod:1.2 docs/perl/5.10.0/perlunicode.pod:1.3 --- docs/perl/5.10.0/perlunicode.pod:1.2 Fri Jan 16 04:56:09 2009 +++ docs/perl/5.10.0/perlunicode.pod Wed Feb 18 00:56:03 2009 @@ -43,6 +43,8 @@ =item Input and Output Layers +(入出力層) + =begin original Perl knows when a filehandle uses Perl's internal Unicode encodings @@ -53,13 +55,13 @@ =end original -Perl knows when a filehandle uses Perl's internal Unicode encodings -(UTF-8, or UTF-EBCDIC if in EBCDIC) if the filehandle is opened with -the ":utf8" layer. Other encodings can be converted to Perl's -encoding on input or from Perl's encoding on output by use of the -":encoding(...)" layer. +Perl は、ファイルハンドルが ":utf8" 層を指定してオープンされると、 +ファイルハンドルが Perl の内部 Unicode エンコーディング +(UTF-8, または EBCDIC の時は UTF-EBCDIC) を使うことが分かります。 +その他のエンコーディングは、":encoding(...)" 層を使うことで、 +入力時の Perl のエンコーディングへの変換や出力時の Perl の +エンコーディングからの変換を行えます。 L<open> を参照してください。 -(TBT) =begin original @@ -72,6 +74,8 @@ =item Regular Expressions +(正規表現) + =begin original The regular expression compiler produces polymorphic opcodes. That is, @@ -435,10 +439,9 @@ =end original -Named Unicode properties, scripts, and block ranges may be used like -character classes via the C<\p{}> "matches property" construct and -the C<\P{}> negation, "doesn't match property". -(TBT) +名前付けされた Unicode の特性、用字、ブロックの範囲は C<\p{}> +"matches property" 構造やその否定形の C<\P{}> "doesn't match property" を +使った文字クラスで使うことができます。 =begin original @@ -456,9 +459,7 @@ =end original -You can define your own character properties and use them -in the regular expression with the C<\p{}> or C<\P{}> construct. -(TBT) +独自の文字特性を定義でき、C<\p{}> や C<\P{}> 構造での正規表現で使えます。 =begin original @@ -466,8 +467,8 @@ =end original -See L</"User-Defined Character Properties"> for more details. -(TBT) +更なる詳細については L</"User-Defined Character Properties"> を +参照してください。 =item * @@ -562,7 +563,7 @@ =end original -Unicodeの文字と符号位置の間の変換を行う新たな C<U> 指定子があります。 +Unicode の文字と符号位置の間の変換を行う新たな C<U> 指定子があります。 There is also a C<W> specifier that is the equivalent of C<chr>/C<ord> and properly handles character values even if they are above 255. (TBT) @@ -677,9 +678,8 @@ =end original -But you can also define your own mappings to be used in the lc(), -lcfirst(), uc(), and ucfirst() (or their string-inlined versions). -(TBT) +しかし lc(), lcfirst(), uc(), ucfirst() (およびこれらの +文字列インライン版) で使える独自のマッピングも定義できます。 =begin original @@ -687,8 +687,7 @@ =end original -See L</"User-Defined Case Mappings"> for more details. -(TBT) +更なる詳細については L</"User-Defined Case Mappings"> を参照してください。 =back