From: "halilsen (Halil Sen)" Date: 2021-11-18T14:32:21+00:00 Subject: [ruby-core:106144] [Ruby master Bug#18345] Duplicate range in character class warning Issue #18345 has been updated by halilsen (Halil Sen). xtkoba (Tee KOBAYASHI) wrote in #note-1: > `|` seems to appear twice. Effectively, I didn't see the `|`s, I must have parse them as logical or. I will open a PR on the grape-swagger side. Cheers xtkoba! https://github.com/ruby-grape/grape-swagger/blob/4ea61c4c2c0bd88043ebc15041b0eb3967b341ff/lib/grape-swagger.rb#L35 ---------------------------------------- Bug #18345: Duplicate range in character class warning https://bugs.ruby-lang.org/issues/18345#change-94742 * Author: halilsen (Halil Sen) * Status: Open * Priority: Normal * ruby -v: >= 2.5.5 * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- ~~~ ruby #!/usr/bin/env ruby -w puts RUBY_VERSION puts "".match?(/[\p{Alnum}|\-|\_]/).inspect puts '--------------' ~~~ ~~~ text 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. -- https://bugs.ruby-lang.org/ Unsubscribe: