[Bug #1196] 正規表現の \s と [\s] が異なる


#1

Bug #1196: e$B@55,I=8=$Ne(B \s e$B$He(B [\s] e$B$,0[$J$ke(B
http://redmine.ruby-lang.org/issues/show/1196

e$B5/I<<Te(B: Masahiro T.
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

e$B@55,I=8=$Ne(B \s e$B$K$Oe(B \v e$B$,4^$^$l$^$;$s$,!"e(B[\s]
e$B$K$Oe(B \v e$B$,4^$^$l$k$h$&$G$9!#e(B

$ ruby -v -e p \v =~ /\s/
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
nil
$ ruby -v -e p \v =~ /[\s]/
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]
0

e$B0J2<$N%Q%C%A$GD>$k$H;W$$$^$9!#e(B

regex.c.orig 2008-08-04 14:15:15.000000000 +0900
+++ regex.c 2009-02-23 18:17:57.000000000 +0900
@@ -2244,6 +2244,7 @@
SET_LIST_BIT(\n);
SET_LIST_BIT(\r);
SET_LIST_BIT(\f);

  •     SET_LIST_BIT('\v');
      }
      else {
        char cc;

#2

e$B%A%1%C%He(B #1196 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%+%F%4%je(B coree$B$K%;%C%He(B
e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$BC4Ev<Te(B Yukihiro M.e$B$K%;%C%He(B

Applied at changeset 22585.

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


#3

e$B%A%1%C%He(B #1196 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.)

e$B%+%F%4%je(B coree$B$K%;%C%He(B
e$B%9%F!<%?%9e(B Closede$B$+$ie(BOpene$B$KJQ99e(B
e$BC4Ev<Te(B Yukihiro M.e$B$+$ie(BShyouhei U.e$B$KJQ99e(B

1.8.7e$B$K%P%C%/%]!<%H$9$k$+9M$(Cf!#e(B

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