Date: Thursday January 02, 2020 @ 05:56 Author: argrath Update of /cvsroot/perldocjp/docs/perl/5.16.1 In directory sf-cvs:/tmp/cvs-serv96714/perl/5.16.1 Modified Files: perlre.pod Log Message: 5.16.1/perlre =================================================================== File: perlre.pod Status: Up-to-date Working revision: 1.2 Wed Jan 1 20:56:52 2020 Repository revision: 1.2 /cvsroot/perldocjp/docs/perl/5.16.1/perlre.pod,v Existing Tags: No Tags Exist -------------- next part -------------- Index: docs/perl/5.16.1/perlre.pod diff -u docs/perl/5.16.1/perlre.pod:1.1 docs/perl/5.16.1/perlre.pod:1.2 --- docs/perl/5.16.1/perlre.pod:1.1 Wed Dec 25 04:39:53 2019 +++ docs/perl/5.16.1/perlre.pod Thu Jan 2 05:56:52 2020 @@ -202,10 +202,9 @@ =end original -Another bug involves character classes that match both a sequence of -multiple characters, and an initial sub-string of that sequence. For -example, -(TBT) +¤â¤¦°ì¤Ä¤Î¥Ð¥°¤Ï¡¢Ê£¿ôʸ»ú¤ÎʤӤȡ¢Ê¤Ӥκǽé¤ÎÉôʬʸ»úÎó¤ÎξÊý¤Ë +¥Þ¥Ã¥Á¥ó¥°¤¹¤ëʸ»ú¥¯¥é¥¹¤Ë¤è¤ë¤â¤Î¤Ç¤¹¡£ +Î㤨¤Ð: /[s\xDF]/i @@ -219,12 +218,12 @@ =end original -should match both a single and a double "s", since C<\xDF> (on ASCII -platforms) matches "ss". However, this bug -(L<[perl #89774]|https://rt.perl.org/rt3/Ticket/Display.html?id=89774>) -causes it to only match a single "s", even if the final larger match -fails, and matching the double "ss" would have succeeded. -(TBT) +¤³¤ì¤Ï "s" °ì¤Ä¤ÈÆó¤Ä¤ÎξÊý¤Ë¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤¹; ¤Ê¤¼¤Ê¤é +(ASCII ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Î) C<\xDF> ¤Ï "ss" ¤Ë¥Þ¥Ã¥Á¥ó¥°¤¹¤ë¤«¤é¤Ç¤¹¡£ +¤·¤«¤·¡¢¤³¤Î¥Ð¥° +(L<[perl #89774]|https://rt.perl.org/rt3/Ticket/Display.html?id=89774>) ¤Ï +Î㤨ºÇ¸å¤Î¤è¤êÂ礤¤¥Þ¥Ã¥Á¥ó¥°¤¬¼ºÇÔ¤·¡¢"ss" ¤¬À®¸ù¤·¤Æ¤â¡¢ +ñ°ì¤Î "s2 ¤Ë¤Î¤ß¥Þ¥Ã¥Á¥ó¥°¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ =begin original @@ -413,14 +412,11 @@ =end original -The C</d>, C</u>, and C</l> modifiers are not likely to be of much use -to you, and so you need not worry about them very much. They exist for -Perl's internal use, so that complex regular expression data structures -can be automatically serialized and later exactly reconstituted, -including all their nuances. But, since Perl can't keep a secret, and -there may be rare instances where they are useful, they are documented -here. -(TBT) +C</d>, C</u>, C</l> ½¤¾þ»Ò¤Ï¤è¤¯»È¤¦¤³¤È¤Ï¤Ê¤¤¤À¤í¤¦¤â¤Î¤Ê¤Î¤Ç¡¢ +¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¤¢¤Þ¤ê¿´ÇÛ¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ +¤³¤ì¤é¤Ï Perl ¤ÎÆâÉô»ÅÍͤΤ¿¤á¤Ë¸ºß¤·¤Æ¤¤¤ë¤Î¤Ç¡¢ +Ê£»¨¤ÊÀµµ¬É½¸½¥Ç¡¼¥¿¹½Â¤¤Ï¼«Æ°Åª¤ËľÎ󲽤µ¤ì¤Æ¡¢¤½¤Î¸åÁ´¤Æ¤Î¥Ë¥å¥¢¥ó¥¹¤ò +´Þ¤á¤ÆÀµ³Î¤ËºÆ¹½À®¤µ¤ì¤Þ¤¹¡£ =begin original @@ -430,10 +426,9 @@ =end original -The C</a> modifier, on the other hand, may be useful. Its purpose is to -allow code that is to work mostly on ASCII data to not have to concern -itself with Unicode. -(TBT) +°ìÊý¡¢C</a> ½¤¾þ»Ò¤ÏÍÍѤ«¤â¤·¤ì¤Þ¤»¤ó¡£ +¤³¤ÎÌÜŪ¤Ï¡¢Unicode ¤Ë´Ø¤·¤Æ¹Íθ¤¹¤ëɬÍפ¬¤Ê¤¤¤è¤¦¤Ë¡¢¥³¡¼¥É¤ò +¤Û¤È¤ó¤É ASCII ¥Ç¡¼¥¿¤È¤·¤ÆÆ°ºî¤¹¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¤¹¡£ =begin original @@ -442,9 +437,8 @@ =end original -Briefly, C</l> sets the character set to that of whatever B<L>ocale is in -effect at the time of the execution of the pattern match. -(TBT) +´Êñ¤Ë¸À¤¦¤È¡¢C</l> ¤Ï¡¢Ê¸»ú½¸¹ç¤ò¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°¤Î¼Â¹Ô»þ¤Ë͸ú¤Ê +¥í¥±¡¼¥ë(B<L>ocale)¤ËÀßÄꤷ¤Þ¤¹¡£ =begin original @@ -452,8 +446,7 @@ =end original -C</u> sets the character set to B<U>nicode. -(TBT) +C</u> ¤Ïʸ»ú½¸¹ç¤ò B<U>nicode ¤ËÀßÄꤷ¤Þ¤¹¡£ =begin original @@ -462,9 +455,8 @@ =end original -C</a> also sets the character set to Unicode, BUT adds several -restrictions for B<A>SCII-safe matching. -(TBT) +C</a> ¤âʸ»ú¥³¡¼¥É¤ò Unicode ¤ËÀßÄꤷ¤Þ¤¹¤¬¡¢ +B<A>SCII ¥»¡¼¥Õ¤Ê¥Þ¥Ã¥Á¥ó¥°¤Î¤¿¤á¤Ë¤¤¤¯¤Ä¤«¤ÎÀ©¸Â¤ò²Ã¤¨¤Þ¤¹¡£ =begin original @@ -473,9 +465,9 @@ =end original -C</d> is the old, problematic, pre-5.14 B<D>efault character set -behavior. Its only use is to force that old behavior. -(TBT) +C</d> ¤Ï¸Å¤¯¤ÆÌäÂê¤Î¤¢¤ë¡¢5.14 °ÊÁ°¤Î¥Ç¥Õ¥©¥ë¥È(B<D>efault)ʸ»ú½¸¹ç¤Î +¿¶¤ëÉñ¤¤¤Ç¤¹¡£ +¤³¤ì¤Ï¸Å¤¤¿¶¤ëÉñ¤¤¤ò¶¯À©¤¹¤ë¤¿¤á¤À¤±¤Ë»È¤¤¤Þ¤¹¡£ =begin original @@ -506,16 +498,15 @@ =end original -The C</l> and C</u> modifiers are automatically selected for -regular expressions compiled within the scope of various pragmas, -and we recommend that in general, you use those pragmas instead of -specifying these modifiers explicitly. +C</l> ¤È C</u> ¤Î½¤¾þ»Ò¤Ï¡¢ÍÍ¡¹¤Ê¥×¥é¥°¥Þ¤Î¥¹¥³¡¼¥×Æâ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ +Àµµ¬É½¸½¤Ç¼«Æ°Åª¤ËÁªÂò¤µ¤ì¤Þ¤¹; +°ìÈÌŪ¤Ë¤Ï¤³¤ì¤é¤Î½¤¾þ»Ò¤òÌÀ¼¨Åª¤Ë»È¤¦¤Î¤Ç¤Ï¤Ê¤¯¡¢¤³¤ì¤é¤Î¥×¥é¥°¥Þ¤ò +»È¤¦¤³¤È¤ò¿Ê¤á¤Þ¤¹¡£ °ìÎã¤òµó¤²¤ë¤È¡¢½¤¾þ»Ò¤Ï¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°¤ËÂФ·¤Æ¤Î¤ß±Æ¶Á¤òÍ¿¤¨¡¢ -ÃÖ´¹¤Ë¤Ï³ÈÄ¥¤µ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤ -, whereas using the pragmas give consistent results for all -appropriate operations within their scopes. +ÃÖ´¹¤Ë¤Ï³ÈÄ¥¤µ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤; +¤¤¤Ã¤Ý¤¦¥×¥é¥°¥Þ¤ò»È¤¦¤È¡¢¤½¤Î¥¹¥³¡¼¥×Æâ¤ÎÁ´¤Æ¤ÎŬÀÚ¤ÊÁàºî¤Ë¤Ä¤¤¤Æ +°ì´Ó¤·¤¿·ë²Ì¤È¤Ê¤ê¤Þ¤¹¡£ Î㤨¤Ð: -(TBT) s/foo/\Ubar/il @@ -530,13 +521,14 @@ =end original -will match "foo" using the locale's rules for case-insensitive matching, -C</l> ¤Ï C<\U> ¤¬¤É¤¦½èÍý¤ò¹Ô¤¦¤«¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤»¤ó¡£ -Most likely you -want both of them to use locale rules. To do this, instead compile the -regular expression within the scope of C<use locale>. This both -implicitly adds the C</l> and applies locale rules to the C<\U>. The -lesson is to C<use locale> and not C</l> explicitly. +¤³¤ì¤ÏÂçʸ»ú¾®Ê¸»ú¥Þ¥Ã¥Á¥ó¥°¤Ë¥í¥±¡¼¥ë¤Îµ¬Â§¤ò»È¤Ã¤Æ "foo" ¤Ë +¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤¹¤¬¡¢C</l> ¤Ï C<\U> ¤¬¤É¤¦½èÍý¤ò¹Ô¤¦¤«¤Ë±Æ¶Á¤òÍ¿¤¨¤Þ¤»¤ó¡£ +¤¢¤Ê¤¿¤Ï¤Û¤Ü³Î¼Â¤Ë¤³¤ì¤éÆó¤Ä¤Ë¥í¥±¡¼¥ë¤Îµ¬Â§¤ò»È¤¦¤³¤È¤òÎפà¤Ï¤º¤Ç¤¹¡£ +¤³¤ì¤ò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢Âå¤ï¤ê¤Ë +C<use locale> ¤Î¥¹¥³¡¼¥×Æâ¤ÇÀµµ¬É½¸½¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£ +¤³¤ì¤é¤ÏξÊý¤È¤â°ÅÌÛ¤Ë C</l> ¤òÄɲä·¡¢C<\U> ¤Ë¥í¥±¡¼¥ë¤Îµ¬Â§¤òŬÍѤ·¤Þ¤¹¡£. +¤³¤³¤Ç³Ø¤Ö¤Ù¤¤³¤È¤Ï¡¢C<use locale> ¤ò»È¤Ã¤Æ¡¢ÌÀ¼¨Åª¤Ë C</l> ¤ò +»È¤ï¤Ê¤¤¤³¤È¤Ç¤¹¡£ =begin original @@ -545,9 +537,8 @@ =end original -Similarly, it would be better to use C<use feature 'unicode_strings'> -instead of, -(TBT) +ƱÍͤˡ¢Unicode ¤Îµ¬Â§¤Ë¤¹¤ë¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤¹¤ëÂå¤ï¤ê¤Ë +C<use feature 'unicode_strings'> ¤ò»È¤Ã¤¿Êý¤¬Îɤ¤¤Ç¤¹: s/foo/\Lbar/iu @@ -558,9 +549,8 @@ =end original -to get Unicode rules, as the C<\L> in the former (but not necessarily -the latter) would also use Unicode rules. -(TBT) +Á°¼Ô¤Î C<\L> (¤·¤«¤·¸å¼Ô¤ÏɬÍפǤϤʤ¤¤Ç¤¹) ¤â Unicode ¤Îµ¬Â§¤ò +»È¤¦¤«¤é¤Ç¤¹¡£ =begin original @@ -570,10 +560,9 @@ =end original -More detail on each of the modifiers follows. Most likely you don't -need to know this detail for C</l>, C</u>, and C</d>, and can skip ahead -to L<E<sol>a|/E<sol>a (and E<sol>aa)>. -(TBT) +¤½¤ì¤¾¤ì¤Î½¤¾þ»Ò¤Ë´Ø¤¹¤ë¤µ¤é¤Ê¤ë¾ÜºÙ¤Ï¸å½Ò¤·¤Þ¤¹¡£ +¤Û¤È¤ó¤É³Î¼Â¤Ë¤¢¤Ê¤¿¤Ï C</l>, C</u>, C</d> ¤Î¾ÜºÙ¤òÃΤëɬÍפϤʤ¯¡¢ +L<E<sol>a|/E<sol>a (and E<sol>aa)> ¤Þ¤ÇÆɤßÈô¤Ð¤»¤Þ¤¹¡£ =head4 /l @@ -698,9 +687,8 @@ C<\d+> ¤Ï¡¢°Û¤Ê¤ëµË¡¤«¤éº®¤¼¤¿¿ô»ú¤Îʸ»úÎó¤Ë¥Þ¥Ã¥Á¥ó¥°¤¹¤ë¤Î¤Ç¡¢ ¥»¥¥å¥ê¥Æ¥£¾å¤ÎÌäÂê¤òºî¤ê¤Þ¤¹¡£ ¤³¤ì¤òÀ°Íý¤¹¤ë¤¿¤á¤Ë L<Unicode::UCD/num()> ¤¬»È¤ï¤ì¤Þ¤¹¡£ -Or the C</a> modifier can be used to force C<\d> to match -just the ASCII 0 through 9. -(TBT) +¤¢¤ë¤¤¤Ï C</a> ½¤¾þ»Ò¤Ï¡¢C<\d> ¤¬Ã±¤Ë ASCII ¤Î 0 ¤«¤é 9 ¤Ë +¥Þ¥Ã¥Á¥ó¥°¤¹¤ë¤³¤È¤ò¶¯À©¤¹¤ë¤¿¤á¤Ë»È¤¨¤Þ¤¹¡£ =begin original @@ -846,10 +834,8 @@ ÍÍ¡¹¤Ê¤³¤È¤Ë°Í¸¤·¤Æ¤¤¤ë¤³¤È¡¢¤Þ¤¿·ë²Ì¤È¤·¤ÆͽÁÛ³°¤Î ·ë²Ì¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£ L<perlunicode/The "Unicode Bug"> ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ -The Unicode Bug has -become rather infamous, leading to yet another (printable) name for this -modifier, "Dodgy". -(TBT) +Unicode ¥Ð¥°¤Ï¡¢°Ì¾¹â¤¯¤Ê¤ê¡¢¤³¤Î½¤¾þ»Ò¤Î¤â¤¦°ì¤Ä¤Î(ɽ¼¨²Äǽ¤Ê) +̾Á° "Dodgy" ¤ò°ú¤µ¯¤³¤·¤Æ¤¤¤Þ¤¹¡£ =begin original @@ -883,9 +869,8 @@ =end original -This modifier is automatically selected by default when none of the -others are, so yet another name for it is "Default". -(TBT) +¤³¤Î½¤¾þ»Ò¤Ï¾¤Î¤â¤Î¤¬»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¥Ç¥Õ¥©¥ë¥È¤È¤·¤Æ¼«Æ°Åª¤Ë +ÀöÂõ¤µ¤ì¤ë¤Î¤Ç¡¢¤³¤ì¤Î¤â¤¦°ì¤Ä¤Î̾Á°¤Ï "Default" ¤Ç¤¹¡£ =begin original @@ -894,9 +879,8 @@ =end original -Because of the unexpected behaviors associated with this modifier, you -probably should only use it to maintain weird backward compatibilities. -(TBT) +¤³¤Î½¤¾þ»Ò¤Ë´Ø¤¹¤ëÁÛÄê³°¤Î¿¶¤ëÉñ¤¤¤Ë¤è¤ê¡¢¤ª¤½¤é¤¯¤ª¤«¤·¤Ê¸åÊý¸ß´¹À¤ò +°Ý»ý¤¹¤ë¤¿¤á¤À¤±¤Ë¤³¤ì¤ò»È¤¦¤Ù¤¤Ç¤·¤ç¤¦¡£ =head4 /a (and /aa) @@ -909,9 +893,8 @@ =end original -This modifier stands for ASCII-restrict (or ASCII-safe). This modifier, -unlike the others, may be doubled-up to increase its effect. -(TBT) +¤³¤Î½¤¾þ»Ò¤Ï ASCII À©¸Â (¤¢¤ë¤¤¤Ï ASCII ¥»¡¼¥Õ) ¤ò°ÕÌ£¤·¤Þ¤¹¡£ +¤³¤Î½¤¾þ»Ò¤Ï¡¢Â¾¤Î¤â¤Î¤È°Û¤Ê¤ê¡¢2 Çܤˤ¹¤ë¤³¤È¤Ç¸ú²Ì¤¬Áý¤·¤Þ¤¹¡£ =begin original @@ -927,14 +910,12 @@ ¤³¤ì¤¬Ã±ÂΤǻȤï¤ì¤ë¤È¡¢C<\d>, C<\s>, C<\w>, Posix ʸ»ú¥¯¥é¥¹¤Ï ASCII ¤ÎÈϰϤΤߤ˥ޥåÁ¥ó¥°¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ -They thus -revert to their pre-5.6, pre-Unicode meanings. +½¾¤Ã¤Æ¡¢¤³¤ì¤é¤Ï 5.6 °ÊÁ°¤Î¡¢Unicode °ÊÁ°¤Î°ÕÌ£¤ËÌᤷ¤Þ¤¹¡£ C</a> ¤Î´ð¤Ç¤Ï¡¢C<\d> ¤Ï¾ï¤ËÀµ³Î¤Ë¿ô»ú C<"0"> ¤«¤é C<"9"> ¤ò°ÕÌ£¤·¤Þ¤¹; C<\s> ¤Ï C<[ \f\n\r\t]> ¤Î 5 ʸ»ú¤ò°ÕÌ£¤·¤Þ¤¹; C<\w> ¤Ï C<[A-Za-z0-9_]> ¤Î 63 ʸ»ú¤ò°ÕÌ£¤·¤Þ¤¹; ƱÍͤˡ¢C<[[:print:]]> ¤Î¤è¤¦¤ÊÁ´¤Æ¤Î Posix ¥¯¥é¥¹¤Ï ŬÀÚ¤Ê ASCII ¤ÎÈϰϤÎʸ»ú¤Ë¤Î¤ß¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤¹¡£ -(TBT) =begin original @@ -944,10 +925,8 @@ =end original -¤³¤Î½¤¾þ»Ò¤Ï¡¢¶öÁ³ Unicode ¤ò»È¤Ã¤Æ¤¤¤ë¿Í¡¹¤Ë¤È¤Ã¤Æ¤ÏÍÍѤǡ¢ -and who do not wish to be burdened with its complexities and security -concerns. -(TBT) +¤³¤Î½¤¾þ»Ò¤Ï¡¢¶öÁ³ Unicode ¤ò»È¤Ã¤Æ¤¤¤ë¿Í¡¹¤Ç¡¢¤½¤ÎÊ£»¨¤µ¤È +¥»¥¥å¥ê¥Æ¥£¤ÎÌäÂê¤Ë´Ø¤¹¤ë½Å²Ù¤òÇØÉ餤¤¿¤¯¤Ê¤¤¿Í¡¹¤Ë¤È¤Ã¤Æ¤ÏÍÍѤǤ¹¡£ =begin original @@ -969,11 +948,9 @@ ASCII ¤òĶ¤¨¤¿¥¹¥Ú¡¼¥¹ (L<perlrecharclass/Whitespace> ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤) ¤È Posix ¥¯¥é¥¹ (L<perlrecharclass/POSIX Character Classes> ¤ò »²¾È¤·¤Æ¤¯¤À¤µ¤¤) ¤ÎξÊý¤Ë¥Þ¥Ã¥Á¥ó¥°¤¹¤ë»÷¤¿¤è¤¦¤Ê C<\p{...}> ¹½Ê¸¤¬¤¢¤ê¤Þ¤¹¡£ -Thus, this modifier -doesn't mean you can't use Unicode, it means that to get Unicode -matching you must explicitly use a construct (C<\p{}>, C<\P{}>) that -signals Unicode. -(TBT) +½¾¤Ã¤Æ¡¢¤³¤Î½¤¾þ»Ò¤Ï Unicode ¤¬»È¤¨¤Ê¤¯¤Ê¤ë¤È¤¤¤¦¤³¤È¤Ç¤Ï¤Ê¤¯¡¢ +Unicode ¤Î¥Þ¥Ã¥Á¥ó¥°¤Ë¤ÏÌÀ¼¨Åª¤Ë Unicode ¤ò°ÕÌ£¤¹¤ë¹½Ê¸ +(C<\p{}>, C<\P{}>) ¤ò»È¤ï¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£ =begin original @@ -1021,13 +998,10 @@ ("k" ¤È C<\N{KELVIN SIGN}> ¤Î¤è¤¦¤Ê) ASCII/Èó-ASCII ¥Þ¥Ã¥Á¥ó¥°¤ò¶Ø»ß¤¹¤ë¤Ë¤Ï¡¢ C</aai> ¤ä C</aia> ¤Î¤è¤¦¤Ë "a" ¤ò 2 ²ó»ØÄꤷ¤Þ¤¹¡£ -(The first -occurrence of "a" restricts the C<\d>, etc., and the second occurrence -adds the C</i> restrictions.) But, note that code points outside the -ASCII range will use Unicode rules for C</i> matching, so the modifier -doesn't really restrict things to just ASCII; it just forbids the -intermixing of ASCII and non-ASCII. -(TBT) +(ºÇ½é¤Î "a" ¤Ï C<\d> ¤Ê¤É¤òÀ©¸Â¤·¡¢2 ÈÖÌÜ¤Ï C</i> ¤ÎÀ©¸Â¤òÄɲä·¤Þ¤¹¡£) +¤·¤«¤·¡¢ ASCII ¤ÎÈϰϳ°¤ÎÉä¹æ°ÌÃÖ¤Ï C</i> ¥Þ¥Ã¥Á¥ó¥°¤Ë Unicode µ¬Â§¤ò +»È¤¦¤Î¤Ç¡¢¤³¤Î½¤¾þ»Ò¤Ï¼ÂºÝ¤Ë¤Ïñ¤Ë ASCII ¤ËÀ©¸Â¤¹¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¤³¤È¤Ë +Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤; ¤³¤ì¤Ïñ¤Ë ASCII ¤ÈÈó ASCII ¤òº®¤¼¤ë¤³¤È¤ò¶Ø»ß¤·¤Þ¤¹¡£ =begin original @@ -1057,15 +1031,13 @@ ¤³¤Î½¤¾þ»Ò¤Ï C<use re '/a'> ¤Þ¤¿¤Ï C<use re '/aa'> ¤Ç¥Ç¥Õ¥©¥ë¥È¤Ë ÀßÄꤵ¤ì¤Þ¤¹¡£ -If you do so, you may actually have occasion to use -the C</u> modifier explictly if there are a few regular expressions -where you do want full Unicode rules (but even here, it's best if -everything were under feature C<"unicode_strings">, along with the -C<use re '/aa'>). +¤½¤¦¤¹¤ë¤È¡¢¤â¤·´°Á´¤Ê Unicode µ¬Â§¤ò»È¤¤¤¿¤¤Àµµ¬É½¸½¤¬¤¢¤ë¾ì¹ç¤Ï¡¢ +C</u> ½¤¾þ»Ò¤òÌÀ¼¨Åª¤Ë»È¤¦µ¡²ñ¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó +(¤½¤Î¾ì¹ç¤Ç¤â¡¢Á´¤Æ¤¬ C<"unicode_strings"> ¤Î´ð¤Ê¤é¡¢ +C<use re '/aa'> ¤È¶¦¤Ë¤¹¤ë¤Î¤¬ºÇÎɤǤ¹)¡£ L</Which character set modifier is in effect?> ¤â»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£ X</a> X</aa> -(TBT) =head4 Which character set modifier is in effect? @@ -1087,14 +1059,13 @@ ¤¢¤ëÀµµ¬É½¸½¤Î¤¢¤ë¥Ý¥¤¥ó¥È¤Ç¤É¤Î½¤¾þ»Ò¤¬Í¸ú¤«¤Ï¡¢¤«¤Ê¤êÊ£»¨¤ÊÁê¸ßºîÍÑ¤Ë °Í¸¤·¤Þ¤¹¡£ -These have -been designed so that in general you don't have to worry about it, but -this section gives the gory details. +¤³¤ì¤é¤Ï¡¢´ðËÜŪ¤Ë¤Ï¤¢¤Ê¤¿¤¬¤³¤ì¤é¤Ë¤Ä¤¤¤Æ¿´ÇÛ¤·¤Ê¤¯¤ÆÎɤ¤¤è¤¦¤Ë +À߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ +¤·¤«¤·¡¢¤³¤ÎÀá¤Ï¾ÜºÙ¤òµ½Ò¤·¤Þ¤¹¡£ L</Extended Patterns> ¤Ç¸å½Ò¤¹¤ë¤È¤ª¤ê¡¢Àµµ¬É½¸½¤Î°ìÉô¤Ë¤À¤± ŬÍѤ¹¤ë½¤¾þ»Ò¤òÌÀ¼¨Åª¤Ë»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ °ìÈÖÆ⦤Τâ¤Î¤Ï¾ï¤Ë¤è¤ê³°Â¦¤Î¤â¤Î¤è¤êÍ¥À褵¤ì¡¢¼°Á´ÂΤËŬÍѤµ¤ì¤ë¤â¤Î¤Ï ¤³¤ÎÀá¤Î»Ä¤ê¤Çµ½Ò¤µ¤ì¤ë¥Ç¥Õ¥©¥ë¥ÈÀßÄê¤è¤êÍ¥À褵¤ì¤Þ¤¹¡£ -(TBT) =begin original @@ -1131,12 +1102,11 @@ C<L<use 5.012|perlfunc/use VERSION>> (¤Þ¤¿¤Ï¤½¤ì°Ê¾å) ¤Ï¡¢ Ʊ¤¸¥¹¥³¡¼¥×¤Ë C<L<use locale|perllocale>> ¤ä C<L<use bytes|bytes>> ¤¬ ¤Ê¤±¤ì¤Ð¡¢¥Ç¥Õ¥©¥ë¥È¤ò C</u> ¤ËÀßÄꤷ¤Þ¤¹¡£ -(C<L<use locale ':not_characters'|perllocale/Unicode and UTF-8>> also -sets the default to C</u>, overriding any plain C<use locale>.) +(C<L<use locale ':not_characters'|perllocale/Unicode and UTF-8>> ¤Ï¤Þ¤¿ +¥Ç¥Õ¥©¥ë¥È¤ò C</u> ¤ËÀßÄꤷ¡¢ÉáÄ̤ΠC<use locale> ¤ò¾å½ñ¤¤·¤Þ¤¹¡£) Á°½Ò¤·¤¿µ¡¹½¤È°Û¤Ê¤ê¡¢¤³¤ì¤é¤ÏÀµµ¬É½¸½¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¥ó¥°°Ê³°¤ÎÁàºî¤Ë ±Æ¶Á¤¹¤ë¤Î¤Ç¡¢ÃÖ´¹¤Ç¤Î C<\U>, C<\l> ¤ò»È¤¦¤³¤È¤ò´Þ¤à¤½¤Î¾¤ÎÁàºî¤È ¤è¤ê°ì´ÓÀ¤Î¤¢¤ë·ë²Ì¤Ë¤Ê¤ê¤Þ¤¹¡£ -(TBT) =begin original @@ -1275,7 +1245,7 @@ =end original Ê£¿ô¹Ô¤Ç¤ÎÍøÍѤò´Êñ¤Ë¤¹¤ë¤¿¤á¤Ë¡¢Ê¸»ú "." ¤Ï C</s> ½¤¾þ»Ò¤ò -»È¤Ã¤Æ Perl ¤Ëʸ»úÎó¤ò1¹Ô¤È¤·¤Æ½èÍý¤¹¤ë¤ÈÅÁ¤¨¤Ê¤¤¸Â¤ê +»È¤Ã¤Æ Perl ¤Ëʸ»úÎó¤ò 1 ¹Ô¤È¤·¤Æ½èÍý¤¹¤ë¤ÈÅÁ¤¨¤Ê¤¤¸Â¤ê ²þ¹Ô¤Ë¤Ï¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤»¤ó¡£ X<.> X</s> @@ -1293,6 +1263,8 @@ °Ê²¼¤Îɸ½àŪ¤ÊÎÌ»ØÄê»Ò¤ò»È¤¨¤Þ¤¹: X<metacharacter> X<quantifier> X<*> X<+> X<?> X<{n}> X<{n,}> X<{n,m}> +=begin original + * Match 0 or more times + Match 1 or more times ? Match 1 or 0 times @@ -1300,6 +1272,15 @@ {n,} Match at least n times {n,m} Match at least n but not more than m times +=end original + + * 0 ²ó°Ê¾å¥Þ¥Ã¥Á¥ó¥° + + 1 ²ó°Ê¾å¥Þ¥Ã¥Á¥ó¥° + ? 0 ²ó¤Þ¤¿¤Ï 1 ²ó¥Þ¥Ã¥Á¥ó¥° + {n} Àµ³Î¤Ë n ²ó¥Þ¥Ã¥Á¥ó¥° + {n,} ºÇÄã n ²ó¥Þ¥Ã¥Á¥ó¥° + {n,m} n ²ó°Ê¾å m ²ó°Ê²¼¥Þ¥Ã¥Á¥ó¥° + =begin original (If a curly bracket occurs in any other context and does not form part of @@ -1317,20 +1298,20 @@ =end original -(¤³¤ì°Ê³°¤Î¥³¥ó¥Æ¥¥¹¥È¤ÇÇȤ«¤Ã¤³¤¬»È¤ï¤ì¤Æ¡¢C<\x{...}> ¤Î¤è¤¦¤Ê -¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥åÉդʤӤΰìÉô¤Ç¤Ï¤Ê¤¤¤È¤¤Ë¤ÏÉáÄ̤Îʸ»ú¤È¤·¤Æ +(¤³¤ì°Ê³°¤Î¥³¥ó¥Æ¥¥¹¥È¤ÇÃ椫¤Ã¤³¤¬»È¤ï¤ì¤Æ¡¢C<\x{...}> ¤Î¤è¤¦¤Ê +¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥åÉդʤӤΰìÉô¤Ç¤Ï¤Ê¤¤¤È¤¤Ë¤Ï¡¢ÉáÄ̤Îʸ»ú¤È¤·¤Æ »È¤ï¤ì¤Þ¤¹¡£ ¤Þ¤¿¡¢²¼¸Â¤ÎÎÌ»ØÄê»Ò¤Ï¾Êά²Äǽ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ -However, in Perl v5.18, it is planned to issue a -deprecation warning for all such occurrences, and in Perl v5.20 to -require literal uses of a curly bracket to be escaped, say by preceding -them with a backslash or enclosing them within square brackets, (C<"\{"> -or C<"[{]">) -This change will allow for future syntax extensions (like -making the lower bound of a quantifier optional), and better error -checking of quantifiers. Now, a typo in a quantifier silently causes -it to be treated as the literal characters. For example, -(TBT) +¤·¤«¤·¡¢Perl v5.18 ¤Ç¤Ï¡¢¤³¤Î¤è¤¦¤Ê¤â¤Î¤ÏÁ´¤ÆÇѤ·Í½Äê·Ù¹ð¤¬È¯À¸¤·¡¢ +Perl v.5.20 ¤Ç¤Ï¡¢Ã椫¤Ã¤³¤ò¥ê¥Æ¥é¥ë¤Ç»È¤¦¤Ë¤Ï¡¢µÕ¥¹¥é¥Ã¥·¥å¤òÁ°ÃÖ¤·¤¿¤ê +Â礫¤Ã¤³¤Ç°Ï¤à (C<"\{"> ¤Þ¤¿¤Ï C<"[{]">) ¤³¤È¤Ç¥¨¥¹¥±¡¼¥×¤¹¤ë¤³¤È¤¬ +Í׵ᤵ¤ì¤ë¤è¤¦¤Ë¤Ê¤ëͽÄê¤Ç¤¹¡£ +¤³¤ÎÊѹ¹¤Ë¤è¤ê¡¢(ÎÌ»ØÄê»Ò¤Î²Ã¸º¤ò¥ª¥×¥·¥ç¥ó¤Ë¤¹¤ë¤è¤¦¤Ê) ¾Íè¤Î +ʸˡ¤Î³ÈÄ¥¤¬¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¡¢ÎÌ»ØÄê»Ò¤Ë´Ø¤¹¤ë¤è¤êÎɤ¤¥¨¥é¡¼¥Á¥§¥Ã¥¯¤¬ +¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ +¸½ºß¤Î¤È¤³¤í¡¢ÎÌ»ØÄê»Ò¤Î¥¿¥¤¥×¥ß¥¹¤Ï·Ù¹ð¤Ê¤·¤Ë¥ê¥Æ¥é¥ë¤Êʸ»ú¤ÎʤӤȤ·¤Æ +°·¤ï¤ì¤Þ¤¹¡£ +Î㤨¤Ð: /o{4,3}/ @@ -1342,10 +1323,9 @@ =end original -looks like a quantifier that matches 0 times, since 4 is greater than 3, -but it really means to match the sequence of six characters -S<C<"o { 4 , 3 }">>.) -(TBT) +¤³¤ì¤Ï¡¢4 ¤Ï 3 ¤è¤êÂ礤¤¤Î¤Ç¡¢0 ²ó¥Þ¥Ã¥Á¥ó¥°¤¹¤ëÎÌ»ØÄê»Ò¤Ë¸«¤¨¤Þ¤¹¤¬¡¢ +¤³¤ì¤Ï¼ÂºÝ¤Ë¤Ï 6 ʸ»úÊÂ¤Ó +S<C<"o { 4 , 3 }">> ¤Ë¥Þ¥Ã¥Á¥ó¥°¤¹¤ë¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£) =begin original @@ -1379,7 +1359,7 @@ =end original -¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ñ¥¿¡¼¥ó¤Ç¹Ô¤ï¤ì¤ëÎÌ»ØÄê¤Ï"ìÅÍß"¤Ç¤¹; +¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Ñ¥¿¡¼¥ó¤Ç¹Ô¤ï¤ì¤ëÎÌ»ØÄê¤Ï¡ÖìÅÍߡפǤ¹; ¤Ä¤Þ¤ê¤½¤ì¤Ï¥Ñ¥¿¡¼¥ó¤Î»Ä¤ê¤ÎÉôʬ¤¬²Äǽ¤ÊÈϰϤǡ¢ (»Ï¤á¤¿ÃÏÅÀ¤«¤é)²Äǽ¤Ê¸Â¤ê¿¤¯¤òÀè¤Ë¤¢¤ë¥Ñ¥¿¡¼¥ó¤Ç¥Þ¥Ã¥Á¥ó¥°¤µ¤»¤Þ¤¹¡£ ¤â¤·ºÇ¾®²ó¿ô¤Ç¤Î¥Þ¥Ã¥Á¥ó¥°¤ò¹Ô¤¤¤¿¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢ÎÌ»ØÄê»Ò¤Î¸å¤í¤Ë @@ -1420,6 +1400,8 @@ ¤·¤«¤·¤³¤Î¿¶¤ëÉñ¤¤¤Ï˾¤Þ¤ì¤Ê¤¤¤³¤È¤â¤¢¤ê¤Þ¤¹¡£ ¤½¤Î¤¿¤á¡¢Perl ¤Ï¡ÖÀäÂкÇÂçÎÌ(possessive)¡×ÎÌ»ØÄê·Á¼°¤âÄ󶡤·¤Æ¤¤¤Þ¤¹¡£ +=begin original + *+ Match 0 or more times and give nothing back ++ Match 1 or more times and give nothing back ?+ Match 0 or 1 time and give nothing back @@ -1427,13 +1409,22 @@ {n,}+ Match at least n times and give nothing back {n,m}+ Match at least n but not more than m times and give nothing back +=end original + + *+ 0 ²ó°Ê¾å¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ + ++ 1 ²ó°Ê¾å¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ + ?+ 0 ²ó¤Þ¤¿¤Ï 1 ²ó¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ + {n}+ ¤Á¤ç¤¦¤É n ²ó¤Î¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ (¾éĹ) + {n,}+ n ²ó°Ê¾å¤Î¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ + {n,m}+ n ²ó°Ê¾å m ²ó°Ê²¼¥Þ¥Ã¥Á¥ó¥°¤·¤Æ²¿¤âÊÖ¤µ¤Ê¤¤ + =begin original For instance, =end original -Î㤨¤Ð, +Î㤨¤Ð¡¢ 'aaaa' =~ /a++a/ @@ -1447,8 +1438,8 @@ =end original -¤Ï¡¢C<a++> ¤¬Ê¸»úÎóÃæ¤ÎÁ´¤Æ¤Î C<a> ¤ò°û¤ß¹þ¤ó¤Ç -¤·¤Þ¤¤¸å¤Ë²¿¤â»Ä¤µ¤Ê¤¤¤¿¤á¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤»¤ó¡£ +¤Ï¡¢C<a++> ¤¬Ê¸»úÎóÃæ¤ÎÁ´¤Æ¤Î C<a> ¤ò°û¤ß¹þ¤ó¤Ç¤·¤Þ¤¤¡¢ +¸å¤Ë²¿¤â»Ä¤µ¤Ê¤¤¤¿¤á¥Þ¥Ã¥Á¥ó¥°¤·¤Þ¤»¤ó¡£ ¤³¤Îµ¡Ç½¤Ï¥Ð¥Ã¥¯¥È¥é¥Ã¥¯¤¹¤ë¤Ù¤¤Ç¤Ê¤¤¾ì½ê¤Î¥Ò¥ó¥È¤ò perl ¤Ë Í¿¤¨¤ë¤Î¤ËÈó¾ï¤ËÊØÍø¤Ç¤¹¡£ Î㤨¤Ð¡¢Åµ·¿Åª¤Ê¡Ö¥À¥Ö¥ë¥¯¥©¡¼¥Èʸ»úÎó¤Î¥Þ¥Ã¥Á¥ó¥°¡×ÌäÂê¤Ç¼¡¤Î¤è¤¦¤Ë @@ -2186,6 +2177,8 @@ =head2 Quoting metacharacters +(¥á¥¿Ê¸»ú¤Î¥¯¥©¡¼¥È) + =begin original Backslashed metacharacters in Perl are alphanumeric, such as C<\b>, @@ -2250,8 +2243,7 @@ =end original -C<quotemeta()> and C<\Q> are fully described in L<perlfunc/quotemeta>. -(TBT) +C<quotemeta()> ¤È C<\Q> ¤Ï L<perlfunc/quotemeta> ¤Ë´°Á´¤Ëµ½Ò¤µ¤ì¤Æ¤¤¤Þ¤¹¡£ =head2 Extended Patterns @@ -3246,10 +3238,9 @@ ³°Â¦¤Ç¤ÏÄ󶡤µ¤ì¤º¡¢¤½¤·¤Æ¤½¤ÎµÕ¤âƱÍͤˤʤëÅÀ¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤; ¥³¡¼¥É¥Ö¥í¥Ã¥¯¤«¤éÊÖ¤µ¤ì¤¿Æ⦤Υѥ¿¡¼¥ó¤¬ ³°Â¦¤ÇÄêµÁ¤µ¤ì¤¿Ê᪥°¥ë¡¼¥×¤ò»²¾È¤¹¤ëÊýË¡¤Ï¤¢¤ê¤Þ¤»¤ó¡£ -(The code block itself can use C<$1>, etc., -to refer to the enclosing pattern's capture groups.) -Î㤨¤Ð¡¢ -(TBT) +(¥³¡¼¥É¥Ö¥í¥Ã¥¯¼«ÂΤϡ¢Æ⦤Υѥ¿¡¼¥ó¤ÎÊ᪥°¥ë¡¼¥×¤ò»²¾È¤¹¤ë¤¿¤á¤Ë +C<$1> ¤Ê¤É¤ò»È¤¨¤Þ¤¹¡£) +½¾¤Ã¤Æ: ('a' x 100)=~/(??{'(.)' x 100})/ @@ -3259,7 +3250,7 @@ =end original -¤³¤ì¤Ï¥Þ¥Ã¥Á¥ó¥° B<¤·¤Þ¤¹ >¤¬¡¢$1 ¤ÏÀßÄê B<¤µ¤ì¤Þ¤»¤ó>¡£ +¤³¤ì¤Ï¥Þ¥Ã¥Á¥ó¥° B<¤·¤Þ¤¹> ¤¬¡¢$1 ¤ÏÀßÄê B<¤µ¤ì¤Þ¤»¤ó>¡£ =begin original @@ -3776,9 +3767,8 @@ =end original -Finally, keep in mind that subpatterns created inside a DEFINE block -count towards the absolute and relative number of captures, so this: -(TBT) +ºÇ¸å¤Ë¡¢DEFINE ¥Ö¥í¥Ã¥¯¤ÎÆ⦤Ǻî¤é¤ì¤¿Éû¥Ñ¥¿¡¼¥ó¤ÏÊ᪤ÎÀäÂÐµÚ¤Ó +ÁêÂÐÈÖ¹æ¤Ç¿ô¤¨¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤; ½¾¤Ã¤Æ¤³¤¦¤¹¤ë¤È: my @captures = "a" =~ /(.) # First capture (?(DEFINE) @@ -3794,10 +3784,9 @@ =end original -Will output 2, not 1. This is particularly important if you intend to -compile the definitions with the C<qr//> operator, and later -interpolate them in another pattern. -(TBT) +1 ¤Ç¤Ï¤Ê¤¯ 2 ¤ò½ÐÎϤ·¤Þ¤¹¡£ +¤³¤ì¤Ï¡¢C<qr//> ±é»»»Ò¤ÇÄêµÁ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¡¢ +¸å¤Ç¾¤Î¥Ñ¥¿¡¼¥ó¤ÎÃæ¤ÇŸ³«¤¹¤ë¤³¤È¤ò°Õ¿Þ¤·¤Æ¤¤¤ë¾ì¹ç¤ËÆä˽ÅÍפǤ¹¡£ =item C<< (?>pattern) >> X<backtrack> X<backtracking> X<atomic> X<possessive> @@ -4437,9 +4426,8 @@ C<(*PRUNE)> ¤Î¤è¤¦¤Ë¡¢¤³¤Îµ¹æ¤Ï¾ï¤Ë¥Þ¥Ã¥Á¥ó¥°¤·¡¢¤½¤·¤Æ¼ºÇÔ¤Ç ¥Ð¥Ã¥¯¥È¥é¥Ã¥¯¤·¤¿»þ¤ËÀµµ¬É½¸½¥¨¥ó¥¸¥ó¤Ë¡¢ÂåÂؤΤ¢¤ë°ìÈÖÆ⦤ÇÊĤ¸¤Æ¤¤¤ë ¥°¥ë¡¼¥×(¥¥ã¥×¥Á¥ã¤Ç¤â¤½¤¦¤Ç¤Ê¤¯¤È¤â)¤Ç¼¡¤ÎÂåÂؤò»î¤ß¤ë¤è¤¦¤Ë¤µ¤»¤Þ¤¹¡£ -The two branches of a C<(?(condition)yes-pattern|no-pattern)> do not -count as an alternation, as far as C<(*THEN)> is concerned. -(TBT) +C<(*THEN)> ¤¬Í¸ú¤Ç¤¢¤ë¸Â¤ê¡¢ +C<(?(condition)yes-pattern|no-pattern)> ¤ÎÆó¤Ä¤Î»Þ¤ÏÂåÂؤȤϰ·¤ï¤ì¤Þ¤»¤ó¡£ =begin original @@ -6063,7 +6051,7 @@ Translate: »³²Ê ɹµû (YAMASHINA Hio) <hio****@hio*****> (5.10.0) Update: SHIRAKATA Kentaro <argra****@ub32*****> (5.10.1-) -Status: in progress +Status: completed =end meta