Here is one tip I used last week when I tried to use VIM to match strings with a pattern not containing a pattern. The requirement is about a group of PL/SQL scripts. I have to update some lines in the script containing "tablespace xxx", where xxx is a table space name. There is one exception: don't change "tablespace temp".
Then I used the following search pattern:
This search is for any line containing word "tablespace" following any spaces, but the following word beginning with "t". The following table explains some special characters in VIM:
|matches 1 or more of the preceding characters...|
|enclosing a pattern as a group.|
|the matched pattern in the n pair of |
"\@!", which means that the word in the group does not contain a word beginning with "t". In my case, "tmp" is an example.
\1is the matched the group 1, i.e., "tablespace" plus white space. Here
gimeans global and ignore case.