How to match russian characters (alphabet) with regex

6,413 views
Skip to first unread message

av

unread,
Jan 24, 2013, 4:43:25 PM1/24/13
to vim...@googlegroups.com
Does someone know how to match russian characters (alphabet) with regex. I tried \w but it does match them.

Thanks

Marcin Szamotulski

unread,
Jan 24, 2013, 5:35:31 PM1/24/13
to vim...@googlegroups.com
On 13:43 Thu 24 Jan , av wrote:
> Does someone know how to match russian characters (alphabet) with regex. I tried \w but it does match them.
>
> Thanks
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
>

Apparently I haven't found anything better than \S. If you need
something more robust you can always type:
/[αβξ]
(sorry I used Greek symbols since I don't know the Russian ones).
You can input them as digraphs (basically with i_CTRL-K, see :h i_^k,
:h :digraphs).

Best,
Marcin

Vlad Irnov

unread,
Jan 24, 2013, 9:59:27 PM1/24/13
to vim...@googlegroups.com, Marcin Szamotulski
If Vim 'encoding' is utf-8 or cp1251 you can match Russian alphabet with
/[А-я,Ё,ё]

Regards,
Vlad

Vlad Irnov

unread,
Jan 24, 2013, 11:42:30 PM1/24/13
to vim...@googlegroups.com, Marcin Szamotulski
Sorry, silly mistake, it should obviously be
/[А-яЁё]

Ben Fritz

unread,
Jan 25, 2013, 10:57:49 AM1/25/13
to vim...@googlegroups.com, Marcin Szamotulski
I'm not sure if it will work with utf-8, but for cp1251 you should be able to modify the 'iskeyword' option to match all the characters you want, then use the \k search item.
Reply all
Reply to author
Forward
0 new messages