This is because egrepno predefined sets \d, \w, \s. Therefore, the old slash in front of them simply matches them literally:
Leonard d o , d avinci
echo "leonardo,davinci" | egrep '[^a-zA-Z0-9 ,]'
Really do not match.
If you installed it, you can use instead pcregrep:echo "leonardo,davinci" | pcregrep '[^\w\s,]'
source
share