You're likely using GNU egrep - the -w
option isn't part of the POSIX standard
- and its manual page states
-w, --word-regexp
Select only those lines containing matches that form whole
words. The test is that the matching substring must either be
at the beginning of the line, or preceded by a non-word
constituent character. Similarly, it must be either at the end
of the line or followed by a non-word constituent character.
Word-constituent characters are letters, digits, and the
underscore.
So @
is considered a non-word constituent character, just like ,
and .
and
whitespace.
If you have an idea of what you'd like the word separators to be, let us know
and we can craft a regexp for you.