egrep '^[^ ]+ +[ACTG]+ *$' # A, C, T, G only
egrep -v '^[^ ]+ +[ACTG]+ *$' # lines not matching the above
The regular expression matches one or more non-space characters at the beginning of the line, followed by one or more spaces, followed by one or more of the characters ACTG, and possible trailing space characters till the end of line. The second command simply uses the "-v" option to invert the search. A shortcoming of that second command is that it would print any
lines that don't match the format. A better, but more complex, command for that second case would be:
egrep '^[^ ]+ +[^ ]*[^ACTG][^ ]* *$'
That one looks for a 2nd field that consists of any number of non-space characters, followed by one character that is not
ACTG, followed by any number of non-space characters, and will print only lines with exactly two fields where the 2nd field contains a character that is not ACTG.