explainshell helpfully explains your command, and gives an excerpt from man grep
:
-w, --word-regexp
Select only those lines containing matches that form whole words.
So just remove -w
since that explicitly does what you don’t want:
grep -rn '/path/to/somewhere/' -e "pattern"