\> are zero-width word boundaries. They allow you to match the beginning and end of words without moving the cursor that's currently evaluating the character.
The difference between
\< \> is that
\W is simply
\< \> are affected by
'iskeyword' which can be different depending on the
filetype. In some files,
hypenated-word is one word, while in others it's two words separated by a non-word character.
\ze are zero-width atoms that set the boundaries for capture group
\0. They are useful for changing what is considered a match.
For instance, you have a list of words:
You want to replace
erry in everything below, but not when
h comes before it. A substitution like
%s/[^h]erry/xxx/g would result in:
It didn't replace
cherry, but it replaced the character that came before
erry in the other words. This is because
[^h] is still part of the match.
You can use
\zs to set the beginning of the match for the substitution with
%s/[^h]\zserry/xxx/g, which will give you:
\ze works the same way, but sets where the match ends.
\ze are particularly useful with the