[Bug #651] Regexp.new returns strange regexp object


#1

Bug #651: Regexp.new returns strange regexp object
http://redmine.ruby-lang.org/issues/show/651

e$B5/I<<Te(B: Shyouhei U.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$BC4Ev<Te(B: Yukihiro M.

e$B0J2<$N$h$&$JEy<0$,@.N)$7$J$/$J$C$?$3$H$K5$$E$-$^$7$?!#e(B

% ruby1.9 -e ‘p( //u == Regexp.new("", nil, “u”) )’
false


#2

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36753] [Bug #651] Regexp.new returns strange
regexp object”
on Thu, 16 Oct 2008 03:31:52 +0900, Shyouhei U.
removed_email_address@domain.invalid writes:

|e$B0J2<$N$h$&$JEy<0$,@.N)$7$J$/$J$C$?$3$H$K5$$E$-$^$7$?!#e(B
|
| % ruby1.9 -e ‘p( //u == Regexp.new("", nil, “u”) )’
| false

e$B$3$l$Oe(B1.9e$B$+$i;0HVL$N0z?t$,L5;k$5$l$k$3$H$K$J$C$?$;$$$G$9!#e(B
e$B$=$N$;$$$G!"e(BRegexp.newe$B$,@8@.$7$?$b$N$Oe(BUTF-8e$B8GDj$G$O$J$/$J$Ce(B
e$B$F$^$9!#e(B

e$B$,!"IT?F@Z$J$N$O3N$+$J$N$G!"e(B

  • -v e$B$,$J$/$F$b7Y9p$9$ke(B
  • e$B%a%C%;!<%8$re(Bobsoletee$B$+$ie(Bignorede$B$KJQ99$9$ke(B

e$B$H$$$&BP1~$K$7$h$&$H;W$$$^$9!#JL$N0F$H$7$F$O!"e(B

  • 'u’e$BBP1~$rI|3h$5$;$ke(B

e$B$H$$$&$b$N$b$"$j$($^$9$,!#e(B


#3

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36755] Re: [Bug #651] Regexp.new returns
strange regexp object”
on Thu, 16 Oct 2008 14:18:48 +0900, Urabe S.
removed_email_address@domain.invalid writes:

|> e$B$,!"IT?F@Z$J$N$O3N$+$J$N$G!"e(B
|>
|> * -v e$B$,$J$/$F$b7Y9p$9$ke(B
|> * e$B%a%C%;!<%8$re(Bobsoletee$B$+$ie(Bignorede$B$KJQ99$9$ke(B
|>
|> e$B$H$$$&BP1~$K$7$h$&$H;W$$$^$9!#e(B
|
|e$BBEEv$G$O$J$$$G$7$g$&$+!#e(B

e$B$H$O$$$(!"!V%(%s%I%f!<%6$,7Y9p$r8+$F$b:$OG$9$k$@$1!W$H$$$&;Xe(B
e$BE&$b$"$j!"G:$^$7$$$H$3$m$G$9!#e(B

|ruby -Kn -e ‘p “\xF0\x80\x80\xBC”.match(Regexp.new(".", nil, “u”))’
|#<MatchData “\xF0”>
|
|e$B$"$?$j$O;v>p$rCN$i$J$$$H$S$C$/$j$7$^$9!#7Y9p$/$i$$$O=P$F$b$$$$$H;W$$$^$9!#e(B

e$B$=$&$G$9$M$(!#e(B

|> e$BJL$N0F$H$7$F$O!“e(B
|>
|> * 'u’e$BBP1~$rI|3h$5$;$ke(B
|>
|> e$B$H$$$&$b$N$b$”$j$($^$9$,!#e(B
|>
|ue$B$H$+e(Bee$B$O$H$b$+$/e(Bne$B$,M_$7$$$3$H$O$"$k$s$8$c$J$$$G$9$+$M$(!#e(B

e$B$"!“e(Bne$B$O$”$$$+$o$i$:M-8z$G$9!#L5;k$5$l$k$h$&$K$J$C$?$N$Oe(Bne$B0J30e(B
e$B$Ne(Bee$B$H$+e(Bse$B$H$+e(Bue$B$H$+$G$9!#e(B


#4

e$B%A%1%C%He(B #651 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r19813.

http://redmine.ruby-lang.org/issues/show/651


#5

e$BKNIt$G$9e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

e$B$3$l$Oe(B1.9e$B$+$i;0HVL$N0z?t$,L5;k$5$l$k$3$H$K$J$C$?$;$$$G$9!#e(B
e$B$=$N$;$$$G!"e(BRegexp.newe$B$,@8@.$7$?$b$N$Oe(BUTF-8e$B8GDj$G$O$J$/$J$Ce(B
e$B$F$^$9!#e(B

e$B$,!"IT?F@Z$J$N$O3N$+$J$N$G!"e(B

  • -v e$B$,$J$/$F$b7Y9p$9$ke(B
  • e$B%a%C%;!<%8$re(Bobsoletee$B$+$ie(Bignorede$B$KJQ99$9$ke(B

e$B$H$$$&BP1~$K$7$h$&$H;W$$$^$9!#e(B

e$BBEEv$G$O$J$$$G$7$g$&$+!#e(B

ruby -Kn -e ‘p “\xF0\x80\x80\xBC”.match(Regexp.new(".", nil, “u”))’
#<MatchData “\xF0”>

e$B$"$?$j$O;v>p$rCN$i$J$$$H$S$C$/$j$7$^$9!#7Y9p$/$i$$$O=P$F$b$$$$$H;W$$$^$9!#e(B

e$BJL$N0F$H$7$F$O!"e(B

  • 'u’e$BBP1~$rI|3h$5$;$ke(B

e$B$H$$$&$b$N$b$"$j$($^$9$,!#e(B

ue$B$H$+e(Bee$B$O$H$b$+$/e(Bne$B$,M_$7$$$3$H$O$"$k$s$8$c$J$$$G$9$+$M$(!#e(B


#6

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:36761] Re: [Bug #651] Regexp.new returns
strange regexp object”
on Fri, 17 Oct 2008 11:44:01 +0900, Urabe S.
removed_email_address@domain.invalid writes:

|e$B$=$&$G$9$+e(B?
|
|% ruby1.9 -ve ‘p( //n == Regexp.new("", nil, “n”) )’
|ruby 1.9.0 (2008-10-17 revision 17576) [x86_64-linux]
|false
|
|# e$BJL$NLdBje(B?

e$BJL$NLdBj$G$7$?!#e(B//ne$B$,e(Bfixede$B$G$J$+$C$?$H$$$&!#e(B


#7

e$BKNIt$G$9!#e(B

Yukihiro M. e$B$5$s$O=q$-$^$7$?e(B:

|> * 'u’e$BBP1~$rI|3h$5$;$ke(B
|>
|> e$B$H$$$&$b$N$b$"$j$($^$9$,!#e(B
|>
|ue$B$H$+e(Bee$B$O$H$b$+$/e(Bne$B$,M_$7$$$3$H$O$"$k$s$8$c$J$$$G$9$+$M$(!#e(B

e$B$"!“e(Bne$B$O$”$$$+$o$i$:M-8z$G$9!#L5;k$5$l$k$h$&$K$J$C$?$N$Oe(Bne$B0J30e(B
e$B$Ne(Bee$B$H$+e(Bse$B$H$+e(Bue$B$H$+$G$9!#e(B

e$B$=$&$G$9$+e(B?

% ruby1.9 -ve ‘p( //n == Regexp.new("", nil, “n”) )’
ruby 1.9.0 (2008-10-17 revision 17576) [x86_64-linux]
false

e$BJL$NLdBje(B?