Project

General

Profile

This project is closed and read-only.

Actions

Backport #1196

closed

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

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

Added by tommy (Masahiro Tomita) over 17 years ago. Updated almost 10 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

Updated by nobu (Nobuyoshi Nakada) over 17 years ago Actions #1

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

=begin
Applied at changeset 22585.
=end

Updated by shyouhei (Shyouhei Urabe) over 17 years ago Actions #2

  • 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

Updated by shyouhei (Shyouhei Urabe) about 16 years ago Actions #3

  • Status changed from Open to Assigned

=begin

=end

Updated by shyouhei (Shyouhei Urabe) almost 10 years ago Actions #4

  • Status changed from Assigned to Closed
Actions

Also available in: PDF Atom