I've want to replace the pattern, say I the arbitrary function $o$ that takes one argument, now, if the two of these function meet in a expression, one with some arugment $B$ and the other with the conjugated argument $B^\dagger$ I want to replace these into one function called $k$ but with the twist, that the argument is now the same letter but lower case symbolically
$$ o(B) o(B^\dagger) \rightarrow k(b) $$ What I thought would work, althought it does not
o[-B] o[-B\[Dagger]] /. o[A__] o[A\[Dagger]__] -> (k[ToExpression@ToLowerCase[ToString[A]]]
sadly this doesn't work. Anyone know the solution?