Project

General

Profile

Actions

Bug #18345

closed

Duplicate range in character class warning

Added by halilsen (Halil Sen) over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:106132]

Description

#!/usr/bin/env ruby -w
puts RUBY_VERSION
puts "".match?(/[\p{Alnum}|\-|\_]/).inspect
puts '--------------'
trial.rb:3: warning: character class has duplicated range: /[\p{Alnum}|\-|\_]/
2.5.5
false
--------------
trial.rb:3: warning: character class has duplicated range: /[\-|\p{Alnum}|\_]/
2.7.4
false
--------------

If I remove any part of the character class definition [], there is no warning but
I don't think there's a duplicate range here, so there should not be a warning.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0