In an expression how can we replace a group of variables $a, b,c,...$ that satisfy the condition $cond(a,b,c,...)$ with other variables $\alpha,\beta,\gamma,...$? I know how to do this in the case of individual constraints, but not in one where the pattern relies on the whole group of variables. E.g. I want to rename the indices in the formula $$F^{abcdef}\cdot(X_{a}Y_{cd}+X_{d}Y_{ac})\cdot(X_{b}Y_{ef}+X_{e}Y_{fb}),$$ so that it can be put into a standard form: $$\tilde{F}^{\alpha\beta\mu\nu\rho\sigma} X_{\alpha}X_{\beta}Y_{\mu\nu}Y_{\rho\sigma}$$ where $\tilde{F}^{\alpha\beta\mu\nu\rho\sigma}$ is a sum of $Fs$. It can be achieved by replacing $i\_,j\_,k\_,m\_,n\_,l\_$ that appear in the combination $X_{i}X_{j}Y_{km}Y_{nl}$ with $\alpha,\beta,\mu,\nu,\rho,\sigma$ (including all possible matches), so what kind of rule should I apply?
Edits:
Desirable output for the example above:
Taking the second terms in the first parenthesis and in the second parenthesis we get $$K_{22}=F^{abcdef}X_{d}Y_{ac}X_{e}Y_{fb}$$
To change it to the standard form, we can rewrite it as $F^{abcdef}X_{d}X_{e}Y_{ac}Y_{fb}$ and apply the rule: $d\rightarrow\alpha,e\rightarrow\beta,a\rightarrow\mu,c\rightarrow\nu,f\rightarrow\rho,b\rightarrow\sigma$. The result is $F^{\mu\sigma\nu\alpha\beta\rho}X_{\alpha}X_{\beta}Y_{\mu\nu}Y_{\rho\sigma}$. Of course, $K_{22}$ can also be arranged as $F^{abcdef}X_{d}X_{e}Y_{fb}Y_{ac}$, $F^{abcdef}X_{e}X_{d}Y_{ac}Y_{fb}$, and $F^{abcdef}X_{e}X_{d}Y_{fb}Y_{ac}$. They will produce different results, which should be added up to get the final result for $K_{22}$. So $$\tilde{F}^{\alpha\beta\mu\nu\rho\sigma} =F^{\mu\sigma\nu\alpha\beta\rho}+...$$ where the ellipsis stands for the other 15 terms.