How+to+match+everything+except+a+certain+group+with+regular+expressions

use negative lookahead

(?!ABC)

Negative lookahead. Specifies a group that cannot match after your main expression (ie. if it matches, the result is discarded

Note that you may have to put some text before the text you are interested in to do the negative lookahead if the group starts at the beginning of the line and there is nothing before it.