elixir
elixir copied to clipboard
`~r/\W/` isn't the reverse of `~r/\w/` for non-ASCII letters
iex(1)> Regex.run(~r/\w+/, "Götterfunken")
["Götterfunken"]
iex(2)> Regex.run(~r/\W+/, "Götterfunken")
["ö"]
This is weird, "ö" is simultaneously a word and a non-word character.
According to the Erlang re module docs: "In UTF-8 mode, characters with values greater than 128 never match \d, \s, or \w, and always match \D, \S, and \W.". That seems to indicate the first match (~r/\w/) is incorrect.
It seems to be a bug in Erlang. Could you please report it to the erlang-bugs mailing list?
Done.
I am following it there and closng it there, thanks!