Subject: [ruby-list:757] Re: [BUG] $1 is not yet set in sub() From: matz@ e m o p Y i r M s o ) Date: Sat, 5 Oct 96 03:23:15 JST References: * In-reply-to: * In message "[ruby-list:756] [BUG] $1 is not yet set in sub()" on 96/10/04, Hara Shin-ichiro <sinara / blade.nagaokaut.ac.jp> writes: | |åã§ãã | |ããã¯ãã°ã ã¨æãã®ã§ããã | |print "AB".sub(/(A)/, $1), ",", $1,"\n" | |ã®åºåã B,A ã¨ãªã£ã¦ãã¾ãã¾ãã$& ãªã©ãåæ§ã§ãã ééãããã
ãã®ãã¥ã¼ããªã¢ã«ã¯ãChris Pineããã® Learn to Programã®å ¨è¨³ã§ãã ããã°ã©ãã³ã°ã®åå¿è ã対象ã«ãããã¥ã¼ããªã¢ã«ã§ãã¤ã¾ãããããã¨ããã ä¸å¯§ã«è§£èª¬ããéæã«æ½ãããç´°ãã工夫ã«ãããé常ã«ããããããå 容ã«ãªã£ã¦ãã¾ãã è¨èªã«ã¯Rubyãé¸æããæ°åã¨æåãã¡ã½ããã¨ã¯ã©ã¹ãªã©ã æ¬å½ã«åºæ¬çãªã¨ãããä¸éã追ãããã¦ãããWebããã°ã©ãã³ã°ãGUIãªã©ã¯ å«ã¾ãã¦ãã¾ããããããã°ã©ãã³ã°ã¨ã¯ä½ããã¨ãããã¨ãç¥ãæåã®æ©ä¼ã«ã¯ã è¯ãããã¹ãã ã¨æãã¾ãã åæã®ãã¥ã¼ããªã¢ã«ã¯ãCGIå¼ã³åºãã«ãããç®æ¬¡ãå ¥ãã¦13ãã¼ã¸ãåºåãã ã²ã¨ã¤ã®å¤§ããªRubyããã°ã©ã ããåºæ¥ã¦ãããä¾é¡ã®ããã°ã©ã ã¯ãªãã¼ããã ãã¨ã«ããã®å ´ã§ãµã¼ãã«ããå®è¡ãããã¨ãã大ããªç¹å¾´ãæã£ã¦ãã¾ãã 翻訳ã®éã¯ããã®ç¹é·ãçãããã¾ã¾ã§ããã ãåæã«å¿ å®ã«ãªãã
æ¦é£ã誰ãã¨ãã³ãºããªã¼ã§è©±ãã¦ãã女æ§ã®å£°ãä¼ããªãã¦å¯ãããããããå·ãããã§ããâæªããä¼è©±ã ãªã¨æãæ¦é£ãè¦ãã¨ãç§ããï¼ãâæ¦é£ã®ç®ãï¾ï¾ãã§ãã¦â¦ 俺ã¯æ°å¼±ã§ãªãããããããããæ®æ®µãããã«ã«ãããããé ·ãäºãããããªäººããå¹³æ°ã§è¨ãããããã¡ããè¨ãè¿ãããéã®ã¬ããããªçä¸å°½ã ããã ãâ¦
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
æçµæ´æ°æ¥ï¼ æ£è¦è¡¨ç¾ã極ããï¼ï¼ å¾ ã£ã¦ããããã¤ããã¾ããè¦ã¤ãã¦ãããããªï¼(ä»®) â ã¯ããã« æ£è¦è¡¨ç¾ãRegular Expressionãï¼ï¼ï¼ï¼å¹´ã«Stephen Kleeneæ°ãè«æã®ä¸ã§ãªã¼ãããã³ã¨ã®åå¤æ§ãç´¹ä»ããã®ãèµ·æºãã ããã§ãã ã§ãã¾ããç°¡åã«ä½ããããã®ãã¨ããã¨ã ã»æååã®ä¸ããç¹å®ã®ãã¿ã¼ã³ãæ¢ãããã«ä½¿ããããè¨æ³ã ã®ãã¨ãè¨ãã¾ãã é常ãæ£è¦è¡¨ç¾ã ããåç¬ã§ä½¿ããããã¨ã¯ãªããä»ã®ããã°ã©ãã³ã°è¨èªã®ä¸ã§ä½¿ããã¾ãã æåãªã¨ããã§è¨ãã¨ãè¯ããã¼ã ãã¼ã¸ã§è¦ãããæ²ç¤ºæ¿ãä½ãã®ã«ä½¿ãããPerlè¨èªã®ä¸ã§ã使ããã¦ããããã¾ãã ãªããæ£è¦è¡¨ç¾ã使ããã¨è¨ãã¨ã ããã°ã©ã ããã¼ã¿ã¯ããã¹ã(æå)ã§æ¸ããã¦ããå ´åãå¤ãã¦ã ã¯ã¼ãã¨ãã«ä»ãã¦ããæ¤ç´¢ãç½®ææ©è½ããããã¼ããã¦ãè¤éãªæ¤ç´¢ãã§ããªãã åã«æåãæ¢ãåºãã
Rubyã®ã¤ã³ã¹ãã¼ã« â Rubyç°å¢ããªãå ´åã¯ã¤ã³ã¹ãã¼ã«ãã¦ãã ããã Windowsç¨ã®Rubyç°å¢ã¯ããã¤ãããã¾ãããããã§ã¯ActiveScriptRuby?ã®ã¤ã³ã¹ãã¼ã«ã®èª¬æããã¾ãã ActiveScriptRuby?ã¯artonæ°ã®ãµã¤ããããã¦ã³ãã¼ãã§ãã¾ãã ã¤ã³ã¹ãã¼ã©ã«å¾ã£ã¦ããã°ã¤ã³ã¹ãã¼ã«çµäºã§ãã â swinã®ã¤ã³ã¹ãã¼ã« â ActiveScriptRuby?ãã¤ã³ã¹ãã¼ã«ãã¦ããå ´åã¯swinã®ã¤ã³ã¹ãã¼ã«ã¯å¿ è¦ãªããããã§ãã ãã以å¤ã®å ´åã¯swinãã¤ã³ã¹ãã¼ã«ãã¾ãããã ããã¤ã³ã¹ãã¼ã«ã®éã«ã¯ä½ãããã®Cã³ã³ãã¤ã©ãå¿ è¦ã«ãªãã¾ãã ãã®ãµã¤ãããvrswin%DATE%.zipããã¦ã³ãã¼ããé©å½ãªãã£ã¬ã¯ããªã«è§£åå¾ã½ã¼ã¹ã®ãããã£ã¬ã¯ããªã§ã c:\temp> ruby extconf.rb c:\temp> make c:\t
ã¨ãããã¨ã§ãã£ã¨Rubyã®åå¼·ãå§ããç§ã ãããä½ããå¦ã¶ã«ã¯äººã«æããã®ãä¸çªãã¨ããããªã·ã¼ã®ç§ã¨ãã¦ã¯ãæ©éRubyã«é¢ããã¨ã³ããªã¼ãæ¸ããã«ã¯ããããªãã Rubyã¨ããè¨èªã«é¢ãã¦ã¯è²ã ãªæè¦ãããã¨ã¯æãããç§ãï¼ãã¾ã®ã¨ããï¼ä¸çªæ°ã«å ¥ã£ã¦ããã®ã¯ã¤ãã¬ã¼ã¿ã¨ããèãæ¹ãããã¯ç¾ãããã§ãããã¨ãªãã°ãforã¨ãwhileã®ãªãè¨èªã«ãã¦ãããã°ãã£ã¨ç¾ããã£ãã®ã«ã¨æããããã ããããããã°ããã¯ãforã¨whileãä¸å使ããã«ã©ãã¾ã§åºæ¥ããã試ãã¦ã¿ããã¨æãã ããæããªããèªã¿å§ããããªãã¸ã§ã¯ãæåã¹ã¯ãªããè¨èªRuby(以ä¸ãRubyæ¬ã)ããRubyã®çã¿ã®è¦ªã§ããã¾ã¤ãã¨ããã²ãæ°èªèº«ã®æã«ãªããã®ã ãå½¼ãªãã®ã¤ãã¬ã¼ã¿ã¸ã®æãå ¥ããä¼ãã£ã¦ããã«éããªã... ã¨ããããã§ããã ãã®æ¬ã®æåã®æ¹ã«åºã¦ãããµã³ãã«ããªããã¤ãã¬ã¼ã¿ã使ããã«whil
ã¡ã³ããã³ã¹
ãç¥ãã
é害
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}