How to highlight something, if it exists, but show error anyway, if it doesn't exist

Actually, I found a way to do it with one check:
Source: ABC|.$
Target: ABC

. wasn’t working because it was always being found first, but .$ is only found if there’s no ABC at all