Project

General

Profile

Actions

Backport #1196

closed

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

Added by tommy (Masahiro Tomita) about 15 years ago. Updated over 7 years ago.


Description

=begin
正規表現の \s には \v が含まれませんが、[\s] には \v が含まれるようです。

$ 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

以下のパッチで直ると思います。

--- 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;
    

=end

Actions #1

Updated by nobu (Nobuyoshi Nakada) about 15 years ago

  • Category set to core
  • Status changed from Open to Closed
  • Assignee set to matz (Yukihiro Matsumoto)

=begin
Applied at changeset 22585.
=end

Actions #2

Updated by shyouhei (Shyouhei Urabe) almost 15 years ago

  • Category set to core
  • Status changed from Closed to Open
  • Assignee changed from matz (Yukihiro Matsumoto) to shyouhei (Shyouhei Urabe)

=begin
1.8.7にバックポートするか考え中。
=end

Actions #3

Updated by shyouhei (Shyouhei Urabe) over 13 years ago

  • Status changed from Open to Assigned

=begin

=end

Actions #4

Updated by shyouhei (Shyouhei Urabe) over 7 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0