\< matches the beginning of a word
\> matches the end of a word
\b matches both boundaries if at the end or at the beginning
The important thing about those special characters is that they match an empty string and not the word boundary itself. a word boundary being the contrary of the the set of character represented by
\w equivalent of
[_[:alnum:]] (letter a to Z, digits and
_) in Posix notation.
Finally, Graeme find a very interesting example:
$ echo 'acegi z' | grep -o '[acegi ]*\>' | cat -A
$ echo 'acegi z' | grep -o '[acegi ]*\b' | cat -A
Currently, this example shows that it can useful sometimes to match precisely the end of word instead of a word boundary because the use of matching space character is avoided by matching the end of word.
So in a more useful example, I would say that if you want to match non-word character and the end of this non-word, you can't use
\>; but maybe
\b can be used in this particular case because it will match the start of the next word.
So far no example manage to reach my mind.
But in my opinion, there are probably some few use cases where it make sense, but my guess is that it's onlyfor readability purpose, Because when you put
\b it's vague but if you precise start or end of the word then it gives a better understanding of the regexp to the persons who read it.