Use word boundary regex matches
29 Apr 2016How do you search for a word?
- "word" will also match "swordsmanship"
- " word " will miss "word: "
- etc.
The answer is simple: word boundaries.
In PCRE (which is a very widely used regex engine, you are likely using this)
you can do \bword\b
, or in Vim's regex engine you can do \<word\>
and it
does exactly what you want.