0
\p{Cyrillic}

Works in my normal regular expressions. When trying to match in Vim or gvim however, I can not seem to get it to work.

I tried something like this:

\p\{Cyrillic}

Is it not supported, or am I missing something?

  • paste the actual text that you want to match with regexp pattern. – klaus Apr 9 at 10:58
  • No, this is not possible. – Christian Brabandt Apr 9 at 12:29
3

Vim has its own regex engine and it doesn't support {Cyrillic}.

You probably want to read :h pattern-atoms and :h /character-classes to find out what you can use in your regexes.

I think the best alternative you can find comes from :h /[] (especially the last example):

\_[]
    A collection.  This is a sequence of characters enclosed in brackets.
    It matches any single character in the collection.

    Example     matches ~
    [xyz]       any 'x', 'y' or 'z'
    [a-zA-Z]$   any alphabetic character at the end of a line
    [А-яЁё]     Russian alphabet (with utf-8 and cp1251)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.