Project

General

Profile

Bug #14488

Unicode characters prevent [[:punct:]] character class from matching certain characters in subsequent matches

Added by patbl (Patrick Brinich-Langlois) over 1 year ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
[ruby-core:85622]

Description

In 2.3.5, [[:punct:]] doesn't match +. In 2.5.0, it does. In 2.4.3, it matches, but not after you match against a string containing one or more unicode characters. I would expect 2.4.3 to have the behavior of 2.5.0.

puts RUBY_VERSION
p %w[+ é +].grep(/[[:punct:]]/)
2.3.5
[]

2.4.3
["+"]

2.5.0
["+", "+"]

One of the commenters here noticed that this behavior may be related to this issue. It seems that [$+<=>^|~]` are affected by the bug, but other punctuation characters aren't (though I tested only a handful of them).

History

#1

Updated by jeremyevans0 (Jeremy Evans) 3 months ago

  • Status changed from Open to Closed

Also available in: Atom PDF