Loading ...
Sorry, an error occurred while loading the content.
 

Re: How to match russian characters (alphabet) with regex

Expand Messages
  • Marcin Szamotulski
    ... 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
    Message 1 of 5 , Jan 24, 2013
      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

      --
      --
      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
    • Vlad Irnov
      ... If Vim encoding is utf-8 or cp1251 you can match Russian alphabet with /[А-я,Ё,ё] Regards, Vlad -- -- You received this message from the vim_use
      Message 2 of 5 , Jan 24, 2013
        On 1/24/13, Marcin Szamotulski <mszamot@...> wrote:
        > 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


        If Vim 'encoding' is utf-8 or cp1251 you can match Russian alphabet with
        /[А-я,Ё,ё]

        Regards,
        Vlad

        --
        --
        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
      • Vlad Irnov
        ... Sorry, silly mistake, it should obviously be /[А-яЁё] -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply
        Message 3 of 5 , Jan 24, 2013
          On 1/24/13, Vlad Irnov <vlad.irnov@...> wrote:
          > On 1/24/13, Marcin Szamotulski <mszamot@...> wrote:
          >> 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
          >
          >
          > If Vim 'encoding' is utf-8 or cp1251 you can match Russian alphabet with
          > /[А-я,Ё,ё]

          Sorry, silly mistake, it should obviously be
          /[А-яЁё]

          --
          --
          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
        • Ben Fritz
          ... 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
          Message 4 of 5 , Jan 25, 2013
            On Thursday, January 24, 2013 8:59:27 PM UTC-6, Vlad Irnov wrote:
            > On 1/24/13, Marcin Szamotulski <mszamot@...> wrote:
            >
            > > 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
            >
            >
            >
            >
            >
            > If Vim 'encoding' is utf-8 or cp1251 you can match Russian alphabet with
            >
            > /[А-я,Ё,ё]
            >

            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.

            --
            --
            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
          Your message has been successfully submitted and would be delivered to recipients shortly.