(Change <tt> to <code>, perhaps also minor tweak.)
Line 4:
Line 4:
|previous=219
|previous=219
|next=222
|next=222
−
|created=February 25, 2002
+
|created=2002
|complexity=intermediate
|complexity=intermediate
|author=Michael Geddes
|author=Michael Geddes
Line 17:
Line 17:
</pre>
</pre>
−
*<tt>\v</tt> Very magic
+
*<code>\v</code> Very magic
−
*<tt><</tt> Start-of-word
+
*<code><</code> Start-of-word
−
*<tt>(Foo>)</tt> The atom 'Foo' followed by end-of-word
+
*<code>(Foo>)</code> The atom 'Foo' followed by end-of-word
−
*<tt>@!</tt> Match (with zero length) when the previous atom doesn't match.
+
*<code>@!</code> Match (with zero length) when the previous atom doesn't match.
−
*<tt>\k+</tt> Match one or more Keywords
+
*<code>\k+</code> Match one or more Keywords
−
*<tt>></tt> Match end-of-word.
+
*<code>></code> Match end-of-word.
The non-magic version is:
The non-magic version is:
Line 30:
Line 30:
</pre>
</pre>
−
The use of <tt>\@!</tt> can be very tricky. According to the Vim help files, it is often easier to use <tt>\@<!</tt> instead. For example, to find all 'bar' strings unless they are part of 'foobar', use the following (non-magic):
+
The use of <code>\@!</code> can be very tricky. According to the Vim help files, it is often easier to use <code>\@<!</code> instead. For example, to find all 'bar' strings unless they are part of 'foobar', use the following (non-magic):
created 2002 · complexity intermediate · author Michael Geddes · version 6.0
This is a regular expression that matches all words except 'foo'
\v<(foo>)@!\k+>
\v Very magic
< Start-of-word
(Foo>) The atom 'Foo' followed by end-of-word
@! Match (with zero length) when the previous atom doesn't match.
\k+ Match one or more Keywords
> Match end-of-word.
The non-magic version is:
\<\(foo\>\)\@!\k\+\>
The use of \@! can be very tricky. According to the Vim help files, it is often easier to use \@<! instead. For example, to find all 'bar' strings unless they are part of 'foobar', use the following (non-magic):