Lets say that i have this text:
$test = \'lorem\'; $test2= \'ipsum\';
and I want to copy lorem and paste into ipsum.
I tried to do yi\'
on lor
I'm not sure what do you want exactly.
You have this on two lines:
$test = 'lorem';
$test2= 'ipsum';
If you go to l and yw, it yanks lorem, then go to i of ipsum, and cw, and p and it will replace ipsum with lorem. You will still have both lorem and ipsum in the registers.
You can get the contents of those registers with :reg
If you want to paste something from them then "*p, or ":p, or "0p (you'll see it when you type :reg)