Russian alphabet includes the letter ё
, which was undeservedly forgotten at beggining of computing.
So, if i want to use a regexp with character diapason, I must mention this letter separately:
[а-яА-яёЁ]
instead of:
[а-яА-Я]
example:
lets we have string "Верёвочка - 12" and need to parse only word by regular expression:
word = "Верёвочка"[/а-яА-Я/] # => ""
word = "Верёвочка"[/а-яА-ЯёЁ/] # => "Верёвочка"
How can I upgrade regexp class in Ruby or Ruby on Rails to resolve this problem?
а-я
by default.\p{Word}
is one I see suggested out there. That will match not only[а-я]
but[a-z]
, etc. too./[[:alpha:]]+/
would work, too