Use the not (^
) symbol:
.*[^a]$
If you put the ^
symbol at the beginning of brackets, it means "everything except the things in the brackets." $
is simply an anchor to the end.
For multiple characters, just put them all in their own character set:
.*[^a][^b]$