regexvimspecial-characterscharacter-class

Characters classes in ranges - vim


Given I have the following string:

This is a test {{ string.string.string }}.

And try to perform the following substitution:

%s/{{ [\w\.]\+ }}/substitute/g

It will not work with the error: Pattern not found.

When I use:

%s/{{ [a-zA-Z\.]\+ }}/substitute/g

It works.

Is there a way to use the meta-character-classes in ranges in VIM?


Solution

  • You can use: