-
this is all dependent on the "magic" option being set to the default,
magic
(:set magic?
will tell you what you're set on) -
vim regexes are beyond reason
-
(defn
finds a literal paren, and\(defn\)
creates a group. -
|
finds a literal pipe and,\|
separates alternatives -
[ring.adapter.jetty
finds literal text, but so does\[ring.adapter.jetty
- however, closing the square bracket makes the stuff inside a character class
- backslashing or omitting either bracket finds literal text instead
-
.
matches any character,\.
matches a literal period -
f\+
matches 1 or more f's, butf*
matches 0 or more -
\d
finds a digit -
\d\{2,}
finds 2 or more digits (note: no backslash on closing bracket)
foo\(bar\)\@=
matches anyfoo
that's followed bybar
foo\(bar\)\@!
matches anyfoo
that's NOT followed bybar
\(foo\)\@<=bar
matches anybar
that's preceded byfoo
\(foo\)\@<!bar
matches anybar
that's NOT preceded byfoo
^\s*\zsuser
matchesuser
at the start of a line, ignoring whitespace^\s*user
matchesuser
at the start of a line, keeping whitespace
\c
(anywhere in the pattern) marks the search as case insensitive