1. replace def with xyz if the string DOESNT have a preceding a: s/^(\SB^aSB*)def/$1xyz/
works fine. (note SB = SQUARE BRACKET, this EDITOR is removing them for some reason)
But let's say instead, only replace if the preceeding string is NOT eq 'abc' exactly?
but no joy. It never substitutes now if preceeded by abc or NOT preceeded by it..