$re = '/"([a-zA-Z]?[a-zA-Z0-9].*)" ?: ?((true|false|null)|([\d].*)),/im';
$str = '{
"LegalFeeNet": 363.54,
"LegalFeeVat": 72.708,
"DiscountNet": 0.0,
"DiscountVat": 0.0,
"OtherNet": 12.0,
"OtherVat": 2.4,
"DisbursementNet": 220.0,
"DisbursementVat": 0.0,
"AmlCheck": null,
"LegalSubTotal": 363.54,
"TotalFee": 450.648,
"Discounts": 0.0,
"Vat": 75.108,
"DiscountedPrice": 360.5184,
"RecommendedRetailPrice": 450.648,
"SubTotal": 375.54
}';
$subst = "$1 = $3$4M,";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php