To get only the lines which not contains ThisNot
but contains ABC
or abc
I tried the regular expression and get no further here:
mm (abc|ABC)_^(?:(?!ThisNot).)+$\w* \[(\d|\d\d)]
Input can be:
mm abc_ThisNot_576as [2]
mm ABC_random_234 [34]
mm abc_random_789 [5]
mm abc_ThisNot2too_576as [2]
Result shall be:
mm ABC_random_234 [34]
mm abc_random_789 [5]