[?] Replace product of unknown variables with a single variable?

I am trying to replace a group of a variable like (L^4)*(lm^4) by a single variable B. PLease suggest how to do it.

Can you provide a specific example? Maybe this?

Hold[(L^4)*(lm^4) + 3 ((L^4)*(lm^4)) + ((L^4)*(lm^4))^2] /. ((L^4)*(lm^4)) -> B // ReleaseHold
(* 4 B + B^2 *)

The Hold is required to prevent the expression from being simplified before the replacement.