First, variables must not be enclosed with single quotes, as they will not be replaced with the real value.
And second, you should use anonymous functions (i.e. closures) instead as they are much easier. Use them like in this example:
$for_callback = function($match) {
return $GLOBALS['replacements'][$match[1]];
};
$result = preg_replace_callback( $regex, $for_callback, $string);
edit: Closures became available in PHP 5.3. So if you are still using PHP < 5.3 you should (really update or) use the following:
$for_callback=create_function('$match','return $GLOBALS[\'replacements\'][$match[1]];');
$result = preg_replace_callback( $regex, $for_callback, $string);