Using egrep instead of grep and fixing the regex