Yukihiro M. wrote:
e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B
In message “Re: [ruby-dev:28449] Re: named capture and /g, /G option”
on Tue, 21 Mar 2006 16:54:57 +0900, “K.Kosako” [email protected] writes:
|Regexp#to_se$B$G!"e(Bg, Ge$B%*%W%7%g%s>pJs$O<N$F$i$l$k$H$$$&$3$H$Ke(B
|e$B$9$k$7$+$J$5$=$&$G$9!#e(B
inspecte$B$G;D$k$J$i!“$^$”!"$$$$$s$8$c$J$$$G$7$g$&$+!#e(B
MatchData[String/Symbol]e$B$N$[$&$O%3%_%C%H$7$^$7$?!#e(B
g, Ge$B%*%W%7%g%s$N$[$&$O!":#F|Cf$K<BAu$G$-$J$$$N$G!“e(B
e$B0l=54V8e$0$i$$$K$d$j$^$9!#e(B
e$B$=$N4V$K;EMM$K$D$$$F2?$+0U8+$,$”$kJ}$O$*4j$$$7$^$9!#e(B
e$B2a5n$Ke(Bruby-deve$B$G=P$?7kO@$K4p$E$$$?;EMM$G$9$,!"e(B
e$B54<V$r%@%&%s%m!<%I$7$F%I%-%e%a%s%H$rFI$`J}$O!“e(B
e$B$”$^$j5o$i$l$J$$$H;W$$$^$9$N$G!"0J2<$K0lIt$re(B
e$B%3%T!<$7$F$*$-$^$9!#e(B
e$B>.Gwe(B
- e$BJa3M<0=89ge(B
e$BJa3M<0=89ge(B(…)e$B$O!"0J2<$N>r7o$K1~$8$F?6Iq$,JQ2=$9$k!#e(B
(e$BL>A0IU$-Ja3M<0=89g$OJQ2=$7$J$$e(B)
case 1. /…/ (e$BL>A0IU$-Ja3M<0=89g$OIT;HMQ!"%*%W%7%g%s$J$7e(B)
(...) e$B$O!"Ja3M<0=89g$H$7$F07$o$l$k!#e(B
case 2. /…/g (e$BL>A0IU$-Ja3M<0=89g$OIT;HMQ!"%*%W%7%g%se(B
'g’e$B$r;XDje(B)
(...) e$B$O!"HsJa3M<0=89g$H$7$F07$o$l$k!#e(B
case 3. /…(?…)…/
(e$BL>A0IU$-Ja3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