In my recent study, I encounter the following problem:

{A,B,C,D}::NonCommuting.
ex:=A B (a-b)+B A (b-a)+A C (a-c)+C A (c-a)+B C (b-c)+C B (c-b);


How to simplify the expression above? i.e. get the result
$$(AB-BA)(a-b)+(AC-CA)(a-c)+(BC-CB)(b-c)$$

edited

Remember that you need to write either a space or a * character to indicate products. Also, NonCommuting is spelled with a single t.

What do you want to do with this? You can distribute(_) this, but there isn't much else you can simplify given that the capital symbols do not commute with each other.

substitute(_,$A?? (B??)+ C?? (D??)|B??+D??=0->(A??-C??) B??$);