I'd like to be able to search
/the\b
to find "the" but not "then".
I also tried searching with very magic turned on:
/\vthe\b
I'd like to be able to search
/the\b
to find "the" but not "then".
I also tried searching with very magic turned on:
/\vthe\b
/the\>
I assume "regexp" means PCRE. It is worth noting that Vim's regex syntax differs from (and apparently predates) PCRE.
See also:
Use \<
and \>
for word start and word end, respectively.
E.g. In your specific case you would use:
/the\>/
If very magic
is turned on, then you shouldn't escape the >
character. See what's magic search.
SO in your case you'd do:
/\v<the>
it would search for only the word 'the'.
if you are trying to search a word at your cursor. you can just hit *, or # for backward search.