Invert the Match with GNU Grep
You can simply invert the match using word boundaries and the specific string you want to reject. For example:
$ egrep --invert-match '\bABC\b' /tmp/corpus
"A" --> Match
"F" --> Match
"AABC" --> Match
"ABCC" --> Match
"CBA" --> Match
This works perfectly on your provided corpus. Your mileage may vary for other (or more complicated) use cases.