Jonas, your edit confuses me a bit. If you were originally using //. then I guess that is not producing the result you want. Would you please include the exact output that you desire?
–
Mr.Wizard♦Feb 11 '12 at 13:35

Jonas, pardon me if I am being slow, but I don't see 3 Hx Re[Ez] vz - 3 Ez Re[Hx] vz in the output after doing the replacement. Again I have to ask, what is the compete result that you are expecting? I am asking you to manually manipulate that complete expression into the form that you desire. I cannot otherwise understand what you expect to end up where.
–
Mr.Wizard♦Feb 11 '12 at 13:53

@Mr.Wizard Sorry about that. I have added some more. There is 3 Hx vz Re[Ez] - 3 Ez vz Re[Hx] in the output which is to me the same but maybe Mathematica sees it differently internally.
–
Jonas TeuwenFeb 11 '12 at 17:07

I should still implement the DelayedRule. First I need to fully understand what is so different ;-).
–
Jonas TeuwenFeb 11 '12 at 17:33

Two questions: 1. why are these kinds of transformations misguided? And, 2. why should you use RuleDelayed with named patterns, it seems to work with just Rule? The second question isn't meant to be facetious, it is more about why use the one, when the other obviously works. And, when do you use named patterns with Rule.
–
rcollyerFeb 11 '12 at 4:00

1

@rcollyer I suppose that you are asking on the OP's behalf. (1) as has been stated elsewhere using replacement rules for mathematical operations is often, but by no means always, problematic, and often, but by no means always, better done differently. (2) RuleDelayed is a matter of good habit; in this case the symbols are undefined and it doesn't matter, but the habit of using { h[x_] -> x } is a pitfall because you are mixing the local and global meanings of x.
–
Mr.Wizard♦Feb 11 '12 at 4:20

For the first question, yes I was. For the second, I wasn't coming up with an example where it would have problems, so I asked.
–
rcollyerFeb 11 '12 at 4:22

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.