tags:

views:

69

answers:

2

Imagine, we have to construct a regexp in vi/vim. Which special characters we have to escape with backslash?

By special characters I mean the following chars: {}|()-[]+*.^$?

Seems like we have to escape: {|()+?

And leave as is: }^$*.[]-

Thanks.

p.s. AFAIK, we have no '?' character in vi/vim but '=' instead which should be also escaped by backslash.

+3  A: 

I think the Vim documentation on magic characters will give you a definitive list.

Brian Agnew
+2  A: 

In vim:

:help magic

Jogusa
Thanks! Vimers call them 'magic' :)
igorp1024