Regex back reference problems

Hello. Take this example:

$old = “hello, world”;
$regex = “(.?), (.?)”;
$new ="\2, strtoupper(\1)";
preg_replace($regex, $new, $old);

This is just an example. Basically I want to be able to edit the backref. If I was using preg_match, then I could just use $matches, but i’m not. What can I do?