[perldocjp-cvs 1705] CVS update: docs/perl/5.10.1

Back to archive index

argra****@users***** argra****@users*****
2013年 2月 7日 (木) 18:04:48 JST


Index: docs/perl/5.10.1/perlrebackslash.pod
diff -u docs/perl/5.10.1/perlrebackslash.pod:1.1 docs/perl/5.10.1/perlrebackslash.pod:1.2
--- docs/perl/5.10.1/perlrebackslash.pod:1.1	Sat Jan 26 20:19:05 2013
+++ docs/perl/5.10.1/perlrebackslash.pod	Thu Feb  7 18:04:47 2013
@@ -1,4 +1,6 @@
 
+=encoding euc-jp
+
 =head1 NAME
 
 =begin original
@@ -74,12 +76,9 @@
 
 =end original
 
-The rules determining what it is are quite simple: if the character
-following the backslash is a punctuation (non-word) character (that is,
-anything that is not a letter, digit or underscore), then the backslash
-just takes away the special meaning (if any) of the character following
-it.
-(TBT)
+これが何かを決定する規則はかなり単純です: 逆スラッシュに引き続く文字が
+句読点(非単語)文字(これは英字、数字、下線以外の全ての文字)なら、
+逆スラッシュは引き続く文字の特別な意味を(もしあるなら)取り除きます。
 
 =begin original
 
@@ -92,13 +91,13 @@
 
 =end original
 
-If the character following the backslash is a letter or a digit, then the
-sequence may be special; if so, it's listed below. A few letters have not
-been used yet, and escaping them with a backslash is safe for now, but a
-future version of Perl may assign a special meaning to it. However, if you
-have warnings turned on, Perl will issue a warning if you use such a sequence.
-[1].
-(TBT)
+逆スラッシュに引き続く文字が英字または数字なら、この並びは特別です;
+その場合、以下に示します。
+いくつかの文字はまだ使われておらず、これを逆スラッシュでエスケープするのは
+今のところは安全ですが、将来のバージョンの Perl はこれに特別な意味を
+割り当てるかもしれません。
+しかし、警告が有効なら、そのような並びを使うと Perl は警告を出力します。
+[1]。
 
 =begin original
 
@@ -109,11 +108,10 @@
 
 =end original
 
-It is however guaranteed that backslash or escape sequences never have a
-punctuation character following the backslash, not now, and not in a future
-version of Perl 5. So it is safe to put a backslash in front of a non-word
-character.
-(TBT)
+しかし、逆スラッシュシーケンスやエスケープシーケンスが逆スラッシュの後に
+句読点文字がくることがないことは今だけではなく将来のバージョンの
+Perl 5 でも保証されています。
+従って、非単語文字の前に逆スラッシュを置くのは安全です。
 
 =begin original
 
@@ -123,10 +121,9 @@
 
 =end original
 
-Note that the backslash itself is special; if you want to match a backslash,
-you have to escape the backslash with a backslash: C</\\/> matches a single
-backslash.
-(TBT)
+逆スラッシュ自体が特別であることに注意してください; 逆スラッシュと
+マッチングしたいなら、逆スラッシュを逆スラッシュでエスケープする必要が
+あります: C</\\/> は単一の逆スラッシュにマッチングします。
 
 =over 4
 
@@ -142,17 +139,21 @@
 
 =end original
 
-There is one exception. If you use an alphanumerical character as the
-delimiter of your pattern (which you probably shouldn't do for readability
-reasons), you will have to escape the delimiter if you want to match
-it. Perl won't warn then. See also L<perlop/Gory details of parsing
-quoted constructs>.
-(TBT)
+一つの例外があります。
+パターンの区切りとして英数字を使っている(おそらくこれは可読性の理由で
+するべきではありません)場合、その文字にマッチングしたいなら区切り文字を
+エスケープする必要があります。
+Perl は警告を出しません。
+L<perlop/Gory details of parsing quoted constructs> も参照してください。
 
 =back
 
 =head2 All the sequences and escapes
 
+(全てのシーケンスとエスケープ)
+
+=begin original
+
  \000              Octal escape sequence.
  \1                Absolute backreference.
  \a                Alarm or bell.
@@ -195,10 +196,58 @@
  \z                End of string.
  \Z                End of string.
 
+=end original
+
+ \000              8 進数エスケープシーケンス。
+ \1                絶対後方参照。
+ \a                アラームまたはベル。
+ \A                文字列の先頭。
+ \b                単語/非単語境界。(文字クラス中なら後退)。
+ \B                単語/非単語境界でない。
+ \cX               Control-X (X は任意の ASCII 文字)。
+ \C                UTF-8 の下でも、単一のオクテット。
+ \d                数字のための文字クラス。
+ \D                非数字のための文字クラス。
+ \e                エスケープ文字。
+ \E                \Q, \L, \U の処理を終了する。
+ \f                書式送り。
+ \g{}, \g1         名前付きの絶対または相対後方参照。
+ \G                位置表明。
+ \h                水平空白のための文字クラス。
+ \H                非水平空白のための文字クラス。
+ \k{}, \k<>, \k''  名前付き後方参照。
+ \K                Keep the stuff left of \K.
+ \l                次の文字を小文字に。
+ \L                \E まで小文字に。
+ \n                (論理) 改行文字。
+ \N{}              名前付き (Unicode) 文字。
+ \p{}, \pP         Unicode 特性付き文字。
+ \P{}, \PP         Unicode 特性なし文字。
+ \Q                \E までクォート。
+ \r                復帰文字。
+ \R                一般的な改行。
+ \s                空白のための文字クラス。
+ \S                非空白のための文字クラス。
+ \t                タブ文字。
+ \u                辻の文字をタイトル文字に。
+ \U                \E まで大文字に。
+ \v                垂直のための文字クラス。
+ \V                非垂直空白のための文字クラス。
+ \w                単語文字の文字クラス。
+ \W                非単語文字のための文字クラス。
+ \x{}, \x00        16 進数エスケープシーケンス。
+ \X                拡張 Unicode 「結合文字の並び」。
+ \z                文字列の末尾。
+ \Z                文字列の末尾。
+
 =head2 Character Escapes
 
+(文字エスケープ)
+
 =head3  Fixed characters
 
+(固定文字)
+
 =begin original
 
 A handful of characters have a dedicated I<character escape>. The following
@@ -207,10 +256,11 @@
 
 =end original
 
-A handful of characters have a dedicated I<character escape>. The following
-table shows them, along with their code points (in decimal and hex), their
-ASCII name, the control escape (see below) and a short description.
-(TBT)
+一部の文字列は I<文字エスケープ> として動作します。
+これらは、符号位置 (10 進と 16 進)、ASCII の名前、制御エスケープ(後述)、
+短い説明と共に、以下の表に示しています。
+
+=begin original
 
  Seq.  Code Point  ASCII   Cntr    Description.
        Dec    Hex
@@ -222,6 +272,18 @@
   \r    13     0D     CR    \cM    carriage return
   \t     9     09    TAB    \cI    tab
 
+=end original
+
+ Seq.   符号位置   ASCII   Cntr    説明。
+      10 進  16 進
+  \a     7     07    BEL    \cG    アラームまたはベル
+  \b     8     08     BS    \cH    後退 [1]
+  \e    27     1B    ESC    \c[    エスケープ文字
+  \f    12     0C     FF    \cL    書式送り
+  \n    10     0A     LF    \cJ    改行 [2]
+  \r    13     0D     CR    \cM    復帰
+  \t     9     09    TAB    \cI    タブ
+
 =over 4
 
 =item [1]
@@ -233,9 +295,8 @@
 
 =end original
 
-C<\b> is only the backspace character inside a character class. Outside a
-character class, C<\b> is a word/non-word boundary.
-(TBT)
+C<\b> は文字クラスの中でのみ復帰文字です。
+文字クラスの外側では、C<\b> は単語非単語境界です。
 
 =item [2]
 
@@ -246,18 +307,22 @@
 
 =end original
 
-C<\n> matches a logical newline. Perl will convert between C<\n> and your
-OSses native newline character when reading from or writing to text files.
-(TBT)
+C<\n> は論理改行にマッチングします。
+Perl はテキストファイルの読み書きをする時には C<\n> OS ネイティブな
+改行文字との間を変換します。
 
 =back
 
 =head4 Example
 
+(例)
+
  $str =~ /\t/;   # Matches if $str contains a (horizontal) tab.
 
 =head3 Control characters
 
+(制御文字)
+
 =begin original
 
 C<\c> is used to denote a control character; the character following C<\c>
@@ -268,12 +333,11 @@
 
 =end original
 
-C<\c> is used to denote a control character; the character following C<\c>
-is the name of the control character. For instance, C</\cM/> matches the
-character I<control-M> (a carriage return, code point 13). The case of the
-character following C<\c> doesn't matter: C<\cM> and C<\cm> match the same
-character.
-(TBT)
+C<\c> は制御文字を示すために使われます; C<\c> に引き続く文字は制御文字の
+名前です。
+例えば、C</\cM/> は I<control-M> (復帰、符号位置 13) にマッチングします。
+C<\c> に引き続く文字の大文字小文字は無視されます: C<\cM> と C<\cm> は同じ
+文字にマッチングします。
 
 =begin original
 
@@ -281,11 +345,12 @@
 
 =end original
 
-Mnemonic: I<c>ontrol character.
-(TBT)
+記憶法: 制御文字(I<c>ontrol character)。
 
 =head4 Example
 
+(例)
+
  $str =~ /\cK/;  # Matches if $str contains a vertical tab (control-K).
 
 =head3 Named characters
@@ -303,13 +368,14 @@
 
 =end original
 
-All Unicode characters have a Unicode name, and characters in various scripts
-have names as well. It is even possible to give your own names to characters.
-You can use a character by name by using the C<\N{}> construct; the name of
-the character goes between the curly braces. You do have to C<use charnames>
-to load the names of the characters, otherwise Perl will complain you use
-a name it doesn't know about. For more details, see L<charnames>.
-(TBT)
+全ての Unicode 文字は Unicode 名を持ち、さまざまな用字の文字も同様に名前を
+持ちます。
+文字に独自の名前をつけることすら可能です。
+C<\N{}> 構文を使って名前による文字を使えます; 文字の名前は中かっこの間に
+書きます。
+文字の名前を読み込むには C<use charnames> とする必要があり、さもなければ
+Perl は知らない名前を使うことについて警告します。
+さらなる詳細については、L<charnames> を参照してください。
 
 =begin original
 
@@ -317,11 +383,12 @@
 
 =end original
 
-Mnemonic: I<N>amed character.
-(TBT)
+記憶法: 名前付き文字(I<N>amed character)。
 
 =head4 Example
 
+(例)
+
  use charnames ':full';               # Loads the Unicode names.
  $str =~ /\N{THAI CHARACTER SO SO}/;  # Matches the Thai SO SO character
 
@@ -342,12 +409,11 @@
 
 =end original
 
-Octal escapes consist of a backslash followed by two or three octal digits
-matching the code point of the character you want to use. This allows for
-512 characters (C<\00> up to C<\777>) that can be expressed this way.
-Enough in pre-Unicode days, but most Unicode characters cannot be escaped
-this way.
-(TBT)
+8 進数エスケープは逆スラッシュに引き続いて使い多い文字の符号位置に
+マッチングする 2 または 3 文字の 8 進数からなります。
+この方法で表現できる 512 文字 (C<\00> から C<\777>) が使えます。
+Unicode 時代以前なら十分でしたが、ほとんどの Unicode 文字はこの方法では
+エスケープできません。
 
 =begin original
 
@@ -357,13 +423,13 @@
 
 =end original
 
-Note that a character that is expressed as an octal escape is considered
-as a character without special meaning by the regex engine, and will match
-"as is".
-(TBT)
+8 進エスケープで表現される文字は正規表現エンジンにとって特別な意味を持たない
+文字として考えられ、「そのまま」でマッチングすることに注意してください。
 
 =head4 Examples
 
+(例)
+
  $str = "Perl";
  $str =~ /\120/;    # Match, "\120" is "P".
  $str =~ /\120+/;   # Match, "\120" is "P", it is repeated at least once.
@@ -371,6 +437,8 @@
 
 =head4 Caveat
 
+(注意)
+
 =begin original
 
 Octal escapes potentially clash with backreferences. They both consist
@@ -380,11 +448,11 @@
 
 =end original
 
-Octal escapes potentially clash with backreferences. They both consist
-of a backslash followed by numbers. So Perl has to use heuristics to
-determine whether it is a backreference or an octal escape. Perl uses
-the following rules:
-(TBT)
+8 進エスケープは潜在的に後方参照を破壊します。
+これらはどちらも逆スラッシュに引き続く数値で構成されます。
+それで Perl は後方参照か 8 進エスケープかを決定するのに発見的手法を
+使います。
+Perl は以下の規則を使います:
 
 =over 4
 
@@ -396,8 +464,7 @@
 
 =end original
 
-If the backslash is followed by a single digit, it's a backreference.
-(TBT)
+逆スラッシュに引き続くのが単一の数字なら、それは後方参照です。
 
 =item 2
 
@@ -407,8 +474,8 @@
 
 =end original
 
-If the first digit following the backslash is a 0, it's an octal escape.
-(TBT)
+逆スラッシュに引き続く文字が 0 なら、それは 8 進エスケープです。
+
 
 =item 3
 
@@ -422,12 +489,11 @@
 
 =end original
 
-If the number following the backslash is N (decimal), and Perl already has
-seen N capture groups, Perl will consider this to be a backreference.
-Otherwise, it will consider it to be an octal escape. Note that if N > 999,
-Perl only takes the first three digits for the octal escape; the rest is
-matched as is.
-(TBT)
+逆スラッシュに引き続く数値が N (10 進) で、Perl がすでに N 個の
+捕捉グループを見ているなら、Perl はこれを後方参照として扱います。
+さもなければ、これは 8 進エスケープとして扱います。
+N > 999 なら、Perl は 8 進エスケープとして最初の 3 桁のみを使うことに
+注意してください; 残りはそのままマッチングされます。
 
  my $pat  = "(" x 999;
     $pat .= "a";
@@ -440,6 +506,8 @@
 
 =head3 Hexadecimal escapes
 
+(16 進数エスケープ)
+
 =begin original
 
 Hexadecimal escapes start with C<\x> and are then either followed by
@@ -449,11 +517,9 @@
 
 =end original
 
-Hexadecimal escapes start with C<\x> and are then either followed by
-two digit hexadecimal number, or a hexadecimal number of arbitrary length
-surrounded by curly braces. The hexadecimal number is the code point of
-the character you want to express.
-(TBT)
+16 進エスケープは C<\x> で始まり、2 桁の 16 進数あるいは中かっこで囲まれた
+任意の桁の 16 進数が引き続きます。
+16 進数は表現したい文字の符号位置です。
 
 =begin original
 
@@ -463,10 +529,8 @@
 
 =end original
 
-Note that a character that is expressed as a hexadecimal escape is considered
-as a character without special meaning by the regex engine, and will match
-"as is".
-(TBT)
+16 進エスケープで表現される文字は正規表現エンジンにとって特別な意味を持たない
+文字として考えられ、「そのまま」でマッチングすることに注意してください。
 
 =begin original
 
@@ -474,11 +538,12 @@
 
 =end original
 
-Mnemonic: heI<x>adecimal.
-(TBT)
+記憶法: 16 進数(heI<x>adecimal)。
 
 =head4 Examples
 
+(例)
+
  $str = "Perl";
  $str =~ /\x50/;    # Match, "\x50" is "P".
  $str =~ /\x50+/;   # Match, "\x50" is "P", it is repeated at least once.
@@ -504,12 +569,10 @@
 
 =end original
 
-A number of backslash sequences have to do with changing the character,
-or characters following them. C<\l> will lowercase the character following
-it, while C<\u> will uppercase (or, more accurately, titlecase) the
-character following it. (They perform similar functionality as the
-functions C<lcfirst> and C<ucfirst>).
-(TBT)
+多くの逆スラッシュシーケンスは、引き続く文字を変更します。
+C<\l> は引き続く文字を小文字に変えます; 一方C<\u> は引き続く文字を大文字(より
+正確にはタイトル文字)にします 
+(これは関数 C<lcfirst> および C<ucfirst> と似たような機能を持ちます)。
 
 =begin original
 
@@ -521,12 +584,10 @@
 
 =end original
 
-To uppercase or lowercase several characters, one might want to use
-C<\L> or C<\U>, which will lowercase/uppercase all characters following
-them, until either the end of the pattern, or the next occurrence of
-C<\E>, whatever comes first. They perform similar functionality as the
-functions C<lc> and C<uc> do.
-(TBT)
+複数の文字を大文字または小文字にするのに、C<\L> または C<\U> を
+使いたいかもしれません; これは、パターンの末尾または次に
+C<\E> が現れるまでの全ての文字を小文字/大文字にします。
+これらは関数 C<lc> および C<uc> が行うのと同じような機能を持ちます。
 
 =begin original
 
@@ -538,12 +599,11 @@
 
 =end original
 
-C<\Q> is used to escape all characters following, up to the next C<\E>
-or the end of the pattern. C<\Q> adds a backslash to any character that
-isn't a letter, digit or underscore. This will ensure that any character
-between C<\Q> and C<\E> is matched literally, and will not be interpreted
-by the regexp engine.
-(TBT)
+C<\Q> は引き続く文字列を、次の C<\E> またはパターンの最後まで
+エスケープします。
+C<\Q> は英字、数字、下線でない全ての文字に逆スラッシュを追加します。
+これにより C<\Q> と C<\E> の間の全ての文字はリテラルにマッチングし、正規表現
+エンジンによって解釈されません。
 
 =begin original
 
@@ -551,11 +611,13 @@
 
 =end original
 
-Mnemonic: I<L>owercase, I<U>ppercase, I<Q>uotemeta, I<E>nd.
-(TBT)
+記憶法: 小文字(I<L>owercase)、大文字(I<U>ppercase)、クォート(I<Q>uotemeta)、
+終了(I<E>nd)。
 
 =head4 Examples
 
+(例)
+
  $sid     = "sid";
  $greg    = "GrEg";
  $miranda = "(Miranda)";
@@ -577,11 +639,10 @@
 
 =end original
 
-Perl regular expressions have a large range of character classes. Some of
-the character classes are written as a backslash sequence. We will briefly
-discuss those here; full details of character classes can be found in
-L<perlrecharclass>.
-(TBT)
+Perl の正規表現は広い範囲の文字クラスを持っています。
+文字クラスの一部は逆スラッシュシーケンスとして書かれます。
+ここではそれらについて簡潔に議論します; 文字クラスに関する完全な詳細は
+L<perlrecharclass> にあります。
 
 =begin original
 
@@ -593,12 +654,12 @@
 
 =end original
 
-C<\w> is a character class that matches any I<word> character (letters,
-digits, underscore). C<\d> is a character class that matches any digit,
-while the character class C<\s> matches any white space character.
-New in perl 5.10.0 are the classes C<\h> and C<\v> which match horizontal
-and vertical white space characters.
-(TBT)
+C<\w> は任意の I<単語> 文字 (英字、数字、下線) にマッチングする
+文字クラスです。
+C<\d> 数字にマッチングする文字クラスです; 一方文字クラス C<\s> は
+空白文字にマッチングします。
+perl 5.10.0 から導入されたのは、それぞれ水平空白文字と垂直空白文字に
+マッチングする C<\h> と C<\v> です。
 
 =begin original
 
@@ -608,10 +669,8 @@
 
 =end original
 
-The uppercase variants (C<\W>, C<\D>, C<\S>, C<\H>, and C<\V>) are
-character classes that match any character that isn't a word character,
-digit, white space, horizontal white space or vertical white space.
-(TBT)
+大文字の変種 (C<\W>, C<\D>, C<\S>, C<\H>, C<\V>) はそれぞれ単語文字、数字、
+空白、水平空白、垂直空白ではない任意の文字にマッチングします。
 
 =begin original
 
@@ -619,8 +678,8 @@
 
 =end original
 
-Mnemonics: I<w>ord, I<d>igit, I<s>pace, I<h>orizontal, I<v>ertical.
-(TBT)
+記憶法: 単語(I<w>ord)、数字(I<d>igit)、空白(I<s>pace)、水平(I<h>orizontal)、
+垂直(I<v>ertical)。
 
 =head3 Unicode classes
 
@@ -638,14 +697,13 @@
 
 =end original
 
-C<\pP> (where C<P> is a single letter) and C<\p{Property}> are used to
-match a character that matches the given Unicode property; properties
-include things like "letter", or "thai character". Capitalizing the
-sequence to C<\PP> and C<\P{Property}> make the sequence match a character
-that doesn't match the given Unicode property. For more details, see
-L<perlrecharclass/Backslashed sequences> and
-L<perlunicode/Unicode Character Properties>.
-(TBT)
+C<\pP> (ここで C<P> は単一の文字) と C<\p{Property}> は与えられた Unicode
+特性にマッチングする文字にマッチングしていました; 特性には "letter" や
+"thai character" のようなものが含まれます。
+並びを C<\PP> と C<\P{Property}> のようにキャピタライズすると、与えられた
+Unicode 特性にマッチングしない文字にマッチングするようになります。
+さらなる詳細については、L<perlrecharclass/Backslashed sequences> と
+L<perlunicode/Unicode Character Properties> を参照してください。
 
 =begin original
 
@@ -653,8 +711,7 @@
 
 =end original
 
-Mnemonic: I<p>roperty.
-(TBT)
+記憶法: 特性(I<p>roperty)。
 
 =head2 Referencing
 
@@ -669,11 +726,10 @@
 
 =end original
 
-If capturing parenthesis are used in a regular expression, we can refer
-to the part of the source string that was matched, and match exactly the
-same thing. There are three ways of referring to such I<backreference>:
-absolutely, relatively, and by name.
-(TBT)
+正規表現で捕捉かっこが使われると、マッチングしたソース文字列の一部を
+参照したり、全く同じものにマッチングしたりできます。
+このような I<後方参照> を参照するには三つの方法があります: 絶対、相対、
+名前付きです。
 
 =for later add link to perlrecapture
 
@@ -691,15 +747,15 @@
 
 =end original
 
-A backslash sequence that starts with a backslash and is followed by a
-number is an absolute reference (but be aware of the caveat mentioned above).
-If the number is I<N>, it refers to the Nth set of parenthesis - whatever
-has been matched by that set of parenthesis has to be matched by the C<\N>
-as well.
-(TBT)
+逆スラッシュで始まり、数値が引き続く逆スラッシュシーケンスは絶対参照です
+(しかし上述した注意を参照してください)。
+数値が I<N> なら、これは N 番目のかっこの組を参照します - 同様にこのかっこの
+組でマッチングしたものは C<\N> でマッチングしたものである必要があります。
 
 =head4 Examples
 
+(例)
+
  /(\w+) \1/;    # Finds a duplicated word, (e.g. "cat cat").
  /(.)(.)\2\1/;  # Match a four letter palindrome (e.g. "ABBA").
 
@@ -719,14 +775,14 @@
 
 =end original
 
-New in perl 5.10.0 is a different way of referring to capture buffers: C<\g>.
-C<\g> takes a number as argument, with the number in curly braces (the
-braces are optional). If the number (N) does not have a sign, it's a reference
-to the Nth capture group (so C<\g{2}> is equivalent to C<\2> - except that
-C<\g> always refers to a capture group and will never be seen as an octal
-escape). If the number is negative, the reference is relative, referring to
-the Nth group before the C<\g{-N}>.
-(TBT)
+perl 5.10.0 からの新機能は捕捉バッファを参照する異なった方法です:
+C<\g> です。
+C<\g> は引数として数値を取ります; 数値は中かっこでかこまれます(中かっこは
+オプションです)。
+数値 (N) に符号がなければ、これは N 番目の捕捉グループです (従って
+C<\g{2}> は C<\2> と等価です - 但し C<\g> は常に捕捉グループへの参照であり、
+8 進エスケープになることはありません)。
+数値が負数なら、参照は相対で、C<\g{-N}> の N 個前のグループを参照します。
 
 =begin original
 
@@ -736,10 +792,8 @@
 
 =end original
 
-The big advantage of C<\g{-N}> is that it makes it much easier to write
-patterns with references that can be interpolated in larger patterns,
-even if the larger pattern also contains capture groups.
-(TBT)
+C<\g{-N}> の大きな利点は、捕捉グループを含んでいるような大きなパターンに
+展開されるような参照のパターンをより簡単に書けることです。
 
 =begin original
 
@@ -747,11 +801,12 @@
 
 =end original
 
-Mnemonic: I<g>roup.
-(TBT)
+記憶法: グループ(I<g>roup)。
 
 =head4 Examples
 
+(例)
+
  /(A)        # Buffer 1
   (          # Buffer 2
     (B)      # Buffer 3
@@ -775,10 +830,10 @@
 
 =end original
 
-Also new in perl 5.10.0 is the use of named capture buffers, which can be
-referred to by name. This is done with C<\g{name}>, which is a
-backreference to the capture buffer with the name I<name>.
-(TBT)
+もう一つの perl 5.10.0 からの新機能は、名前で参照できる名前付き捕捉バッファの
+使用です。
+これは C<\g{name}> として行われます; これは I<name> という名前の
+捕捉バッファへの後方参照です。
 
 =begin original
 
@@ -787,9 +842,8 @@
 
 =end original
 
-To be compatible with .Net regular expressions, C<\g{name}> may also be
-written as C<\k{name}>, C<< \k<name> >> or C<\k'name'>.
-(TBT)
+.Net 正規表現との互換性のために、C<\g{name}> は C<\k{name}>, C<< \k<name> >>,
+C<\k'name'> とも書けます。
 
 =begin original
 
@@ -800,14 +854,15 @@
 
 =end original
 
-Note that C<\g{}> has the potential to be ambiguous, as it could be a named
-reference, or an absolute or relative reference (if its argument is numeric).
-However, names are not allowed to start with digits, nor are allowed to
-contain a hyphen, so there is no ambiguity.
-(TBT)
+C<\g{}> は潜在的には曖昧であることに注意してください; 名前付き
+参照かもしれませんし、(引数が数値なら)絶対または相対参照かもしれません。
+しかし、名前は数字で始めたり、ハイフンを含めたりすることはできないので、
+ここに曖昧さはありません。
 
 =head4 Examples
 
+(例)
+
  /(?<word>\w+) \g{word}/ # Finds duplicated word, (e.g. "cat cat")
  /(?<word>\w+) \k{word}/ # Same.
  /(?<word>\w+) \k<word>/ # Same.
@@ -826,10 +881,9 @@
 
 =end original
 
-Assertions are conditions that have to be true -- they don't actually
-match parts of the substring. There are six assertions that are written as
-backslash sequences.
-(TBT)
+表明は真である必要がある条件です -- 実際に部分文字列の一部に
+マッチングすることはありません。
+逆スラッシュシーケンスとして書かれる六つの表明があります。
 
 =over 4
 
@@ -845,12 +899,12 @@
 
 =end original
 
-C<\A> only matches at the beginning of the string. If the C</m> modifier
-isn't used, then C</\A/> is equivalent with C</^/>. However, if the C</m>
-modifier is used, then C</^/> matches internal newlines, but the meaning
-of C</\A/> isn't changed by the C</m> modifier. C<\A> matches at the beginning
-of the string regardless whether the C</m> modifier is used.
-(TBT)
+C<\A> は文字列の先頭にのみマッチングします。
+C</m> 修飾子が使われていなければ、C</\A/> は C</^/> と等価です。
+しかし、C</m> 修飾子が使われると、C</^/> は内部改行にマッチングしますが、
+C</\A/> の意味は C</m> 修飾子によって変わりません。
+C<\A> は、C</m> 修飾子が使われるかどうかに関わらず文字列の先頭に
+マッチングします。
 
 =item \z, \Z
 
@@ -866,14 +920,14 @@
 
 =end original
 
-C<\z> and C<\Z> match at the end of the string. If the C</m> modifier isn't
-used, then C</\Z/> is equivalent with C</$/>, that is, it matches at the
-end of the string, or before the newline at the end of the string. If the
-C</m> modifier is used, then C</$/> matches at internal newlines, but the
-meaning of C</\Z/> isn't changed by the C</m> modifier. C<\Z> matches at
-the end of the string (or just before a trailing newline) regardless whether
-the C</m> modifier is used.
-(TBT)
+C<\z> と C<\Z> は文字列の末尾にマッチングします。
+C</m> 修飾子が使われていなければ、C</\Z/> は C</$/> と等価で、文字列の
+末尾か、文字列の末尾の改行の手前にマッチングします。
+C</m> 修飾子が使われると、C</$/> は内部改行にマッチングしますが、
+C</\Z/> の意味は C</m> 修飾子によって変わりません。
+C<\Z> は、C</m> 修飾子が使われるかどうかに関わらず文字列の末尾(あるいは
+末尾の改行の直前)にマッチングします。
+
 
 =begin original
 
@@ -883,10 +937,9 @@
 
 =end original
 
-C<\z> is just like C<\Z>, except that it will not match before a trailing
-newline. C<\z> will only match at the end of the string - regardless of the
-modifiers used, and not before a newline.
-(TBT)
+C<\z> は C<\Z> と同様ですが、末尾の改行の手前ではマッチングしません。
+C<\z> は文字列の末尾にのみマッチングします - 修飾子が使われるかや改行の
+前かに関わりません。
 
 =item \G
 
@@ -899,11 +952,10 @@
 
 =end original
 
-C<\G> is usually only used in combination with the C</g> modifier. If the
-C</g> modifier is used (and the match is done in scalar context), Perl will
-remember where in the source string the last match ended, and the next time,
-it will start the match from where it ended the previous time.
-(TBT)
+C<\G> は普通は C</g> 修飾子との組み合わせでのみ使われます。
+C</g> 修飾子が使われると(そしてマッチングがスカラ根的宇土で行われると)、
+Perl は最後のマッチングが終了したソース文字列の位置を覚えていて、次回の
+マッチングでは、前回終わった位置からマッチングを開始します。
 
 =begin original
 
@@ -912,9 +964,8 @@
 
 =end original
 
-C<\G> matches the point where the previous match ended, or the beginning
-of the string if there was no previous match.
-(TBT)
+C<\G> は前回のマッチングが終了した位置、あるいは前回にマッチングがなければ
+文字列の先頭にマッチングします。
 
 =for later add link to perlremodifiers
 
@@ -924,8 +975,7 @@
 
 =end original
 
-Mnemonic: I<G>lobal.
-(TBT)
+記憶法: グローバル(I<G>lobal)。
 
 =item \b, \B
 
@@ -940,13 +990,12 @@
 
 =end original
 
-C<\b> matches at any place between a word and a non-word character; C<\B>
-matches at any place between characters where C<\b> doesn't match. C<\b>
-and C<\B> assume there's a non-word character before the beginning and after
-the end of the source string; so C<\b> will match at the beginning (or end)
-of the source string if the source string begins (or ends) with a word
-character. Otherwise, C<\B> will match.
-(TBT)
+C<\b> は単語文字と非単語文字の境界にマッチングします; C<\B> は C<\b> が
+マッチングしない任意の文字間にマッチングします。
+C<\b> と C<\B> は、ソース文字列の先頭の前と末尾の後ろに非単語文字があると
+仮定します; 従って C<\b> は、ソース文字列が単語文字で始まっている(または
+終わっている)場合はソース文字列の先頭(または末尾)にマッチングします。
+さもなければ、C<\B> がマッチングします。
 
 =begin original
 
@@ -954,13 +1003,14 @@
 
 =end original
 
-Mnemonic: I<b>oundary.
-(TBT)
+記憶法: 境界(I<b>oundary)。
 
 =back
 
 =head4 Examples
 
+(例)
+
   "cat"   =~ /\Acat/;     # Match.
   "cat"   =~ /cat\Z/;     # Match.
   "cat\n" =~ /cat\Z/;     # Match.
@@ -989,9 +1039,9 @@
 
 =end original
 
-Here we document the backslash sequences that don't fall in one of the
-categories above. They are:
-(TBT)
+ここでは上述のカテゴリの一つに当てはまらない逆スラッシュシーケンスについて
+記述します。
+それは:
 
 =over 4
 
@@ -1005,10 +1055,10 @@
 
 =end original
 
-C<\C> always matches a single octet, even if the source string is encoded
-in UTF-8 format, and the character to be matched is a multi-octet character.
-C<\C> was introduced in perl 5.6.
-(TBT)
+C<\C> は、例えソース文字列が UTF-8 形式でエンコードされていても、
+常に単一のオクテットにマッチングし、マッチングする文字は複数オクテット
+文字です。
+C<\C> は perl 5.6 で導入されました。
 
 =begin original
 
@@ -1016,8 +1066,7 @@
 
 =end original
 
-Mnemonic: oI<C>tet.
-(TBT)
+記憶法: オクテット(oI<C>tet)。
 
 =item \K
 
@@ -1030,11 +1079,11 @@
 
 =end original
 
-This is new in perl 5.10.0. Anything that is matched left of C<\K> is
-not included in C<$&> - and will not be replaced if the pattern is
-used in a substitution. This will allow you to write C<s/PAT1 \K PAT2/REPL/x>
-instead of C<s/(PAT1) PAT2/${1}REPL/x> or C<s/(?<=PAT1) PAT2/REPL/x>.
-(TBT)
+これは perl 5.10.0 からの新しいものです。
+C<\K> の左側でマッチングしたものは C<$&> に含まれません - そして
+パターンが置換で使われた場合は置き換えられません。
+これにより、C<s/(PAT1) PAT2/${1}REPL/x> or C<s/(?<=PAT1) PAT2/REPL/x> の
+代わりに C<s/PAT1 \K PAT2/REPL/x> と書けます。
 
 =begin original
 
@@ -1042,8 +1091,7 @@
 
 =end original
 
-Mnemonic: I<K>eep.
-(TBT)
+Mnemonic: 保持(I<K>eep)。
 
 =item \R
 
@@ -1060,15 +1108,15 @@
 
 =end original
 
-C<\R> matches a I<generic newline>, that is, anything that is considered
-a newline by Unicode. This includes all characters matched by C<\v>
-(vertical white space), and the multi character sequence C<"\x0D\x0A">
-(carriage return followed by a line feed, aka the network newline, or
-the newline used in Windows text files). C<\R> is equivalent with
-C<< (?>\x0D\x0A)|\v) >>. Since C<\R> can match a more than one character,
-it cannot be put inside a bracketed character class; C</[\R]/> is an error.
-C<\R> was introduced in perl 5.10.0.
-(TBT)
+C<\R> は I<一般的な改行> にマッチングします; これは Unicode で改行として
+扱われるものです。
+これには C<\v> (垂直空白) でマッチングする全ての文字、複数文字並び
+C<"\x0D\x0A"> (復帰に引き続いて改行、またの名をネットワーク改行、
+または Windows テキストファイルで使われる改行) を含みます。
+C<\R> は C<< (?>\x0D\x0A)|\v) >> と等価です。
+C<\R> は複数の文字にマッチングするので、大かっこ文字クラスの内側には
+使えません; C</[\R]/> はエラーです。
+C<\R> は perl 5.10.0 で導入されました。
 
 =begin original
 
@@ -1078,10 +1126,10 @@
 
 =end original
 
-Mnemonic: none really. C<\R> was picked because PCRE already uses C<\R>,
-and more importantly because Unicode recommends such a regular expression
-metacharacter, and suggests C<\R> as the notation.
-(TBT)
+記憶法: 実際のところありません。
+C<\R> が選ばれたのは、PCRE が既に C<\R> を使っていて、さらに重要なのは
+Unicode がこのような正規表現メタ文字を勧めていて、記法として C<\R> を
+提案しているからです。
 
 =item \X
 
@@ -1097,14 +1145,13 @@
 
 =end original
 
-This matches an extended Unicode I<combining character sequence>, and
-is equivalent to C<< (?>\PM\pM*) >>. C<\PM> matches any character that is
-not considered a Unicode mark character, while C<\pM> matches any character
-that is considered a Unicode mark character; so C<\X> matches any non
-mark character followed by zero or more mark characters. Mark characters
-include (but are not restricted to) I<combining characters> and
-I<vowel signs>.
-(TBT)
+これは拡張された Unicode の I<結合文字の並び> にマッチングし、
+C<< (?>\PM\pM*) >> と等価です。
+C<\PM> は Unicode マーク文字ではない任意の文字にマッチングし、一方
+C<\pM> は Unicode マーク文字にマッチングします; それで C<\X> は
+任意の非マーク文字に 0 個以上のマーク文字にマッチングします。
+マーク文字には I<結合文字の並び> と I<母音マーク> を含みます (しかし
+これだけではありません)。
 
 =begin original
 
@@ -1115,11 +1162,10 @@
 
 =end original
 
-C<\X> matches quite well what normal (non-Unicode-programmer) usage
-would consider a single character: for example a base character
-(the C<\PM> above), for example a letter, followed by zero or more
-diacritics, which are I<combining characters> (the C<\pM*> above).
-(TBT)
+C<\X> は普通の (非 Unicode プログラマの) 使い方で単一の文字と考えられるものに
+かなりうまくマッチングします: 例えば基底文字 (上述の C<\PM>)、例えば文字、
+引き続いて 0 以上のダイアクリティカルマーク、つまり I<結合文字> (上述の
+C<\pM*>) です。
 
 =begin original
 
@@ -1127,8 +1173,7 @@
 
 =end original
 
-Mnemonic: eI<X>tended Unicode character.
-(TBT)
+記憶法: 拡張 Unicode 文字(eI<X>tended Unicode character)。
 
 =back
 
@@ -1150,7 +1195,7 @@
 =begin meta
 
 Translate: SHIRAKATA Kentaro <argra****@ub32*****> (5.10.1)
-Status: in progress
+Status: completed
 
 =end meta
 



perldocjp-cvs メーリングリストの案内
Back to archive index