I just pulled out The CookBook and I think I see your problem. Have you tried to just escape the @ in the expression that you want to replace the first with? It looks like the string you're searching for is quoted with \Q \E so it's interpreting your \ in the first expression as a real \.