# Factorizing non commutative terms

Is it possible to factor

a ** b ** c - a ** b ** d


as

a ** b ** (c - d)


?

I am using NCAlgebra. Using NCExpand, we can check that

NCExpand[a ** b ** (c - d) == a ** b ** c - a ** b ** d]
(* True *)


Note that a*x - a*y // Factor or a*x - a*y // Simplify return a*(x-y), however.

One possibility is to use NCCollect (from the NCAlgebra package):
NCCollect[a ** b ** c - a ** b ** d, {a, b}]