For example when I'm trying to find and replace something using


Vim showing error: Pattern not found: [:digit:], while the string contains digits.

Following POSIX Bracket Expressions are not working: [:digit:], [:xdigit:], [:upper:], [:lower:], [:print:], [:cntrl:]

At the same time all the others POSIX Bracket Expressions (like [:alnum:], [:alpha:], [:blank:] etc. work pretty well.

Vim version 7.4


1 Answer 1


The [:foo:] bracket expression is meant to be used inside a [...] collection, like this:


This allows you to specify multiple (alternative; otherwise it would be concatenation) groups, and mix with other characters, e.g.: [[:space:][:digit:]abc].

  • Thanks a lot, it works! But why some bracket expressions require that so called [:foo:] bracket expression, while others don't?
    – Alexander
    Feb 3, 2015 at 14:08
  • 1
    I think you just got false positives from those. Feb 3, 2015 at 16:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .