Project

General

Profile

Actions

Bug #7471

closed

character class has duplicated range warning for "" =~ /[\w\W]/

Added by drbrain (Eric Hodel) over 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
-
Backport:
[ruby-core:50344]

Description

=begin
The warning seems bogus, \w and \W do not overlap.

$ cat test.rb
$-w = true

""=~/[\w\W]/
$ make runruby
/Users/drbrain/Work/svn/ruby/trunk/test.rb:3: warning: character class has duplicated range: /[\w\W]/

There is no warning with 1.9.3:

$ ~/.multiruby/install/1.9.3-p194/bin/ruby -v test.rb
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin12.1.0]
[no output]

This affects abbrev.rb:

/usr/local/lib/ruby/2.0.0/abbrev.rb:77: warning: character class has duplicated range: /[\w\W]\z/

=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0