Actions
Bug #2822
closedRussian characters are missing from word characters types in Regexp
Description
=begin
"Hello".match(/[\w]*/)
=> #<MatchData "Hello">
"Привет".match(/[\w]*/)
=> #<MatchData "">
"Привет".match(/[А-Яа-яЁё\w]*/)
=> #<MatchData "Привет">
Non word character type \W behaves similar.
=end
Updated by Eregon (Benoit Daloze) almost 15 years ago
=begin
$ ri Regexp
/\w/ - A word character ([a-zA-Z0-9_])
/[[:word:]]/ - A character in one of the following Unicode
general categories Letter, Mark, Number,
Connector_Punctuation<i/i>
/\p{Word}/ - A member of one of the following Unicode general
category Letter, Mark, Number, Connector_Punctuation
"aér".match /\w+/
=> #<MatchData "a">
"aér".match /[[:word:]]+/
=> #<MatchData "aér">
"aér".match /\p{Word}+/
=> #<MatchData "aér">
The documentation of Regexp is awesome in Ruby 1.9, have a look ;)
=end
Actions
Like0
Like0Like0