From: "akr (Akira Tanaka)" Date: 2013-04-02T11:08:24+09:00 Subject: [ruby-core:53888] [ruby-trunk - Bug #8151] Duplicate character class warning Issue #8151 has been updated by akr (Akira Tanaka). Assignee changed from akr (Akira Tanaka) to naruse (Yui NARUSE) The warning is proposed by [ruby-core:24593] [Feature #1831] (2009-07-29) and committed by naruse. It is seven years later than my Regexp#to_s [ruby-dev:16951] (2002-04-18) It seems this issue is better to assign naruse. ---------------------------------------- Bug #8151: Duplicate character class warning https://bugs.ruby-lang.org/issues/8151#change-38094 Author: tenderlovemaking (Aaron Patterson) Status: Assigned Priority: Normal Assignee: naruse (Yui NARUSE) Category: Target version: ruby -v: ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.1] I get a duplicate character class warning, but I think it's a bug. Here is the example code: ``` def embed exp, depth return exp if depth == 0 embed(/#{exp}/, depth - 1) end 3.times { |i| puts "DEPTH #{i + 1}" embed(/[a-z\u{7b}-\u{7d}]/, i + 1) } ``` At depth = 1, there is no warning, but greater than 1, I get a duplicate character class warning. I don't think the character class overlaps, so there should never be a warning. -- http://bugs.ruby-lang.org/