$re = '/([\w\.:-]*)=(\d)+(,|})/';
$str = '{ok_sock_to_host_close_10.205.148.134:32001=6, ok_sock_to_host_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=6, ok_sock_to_host_10.205.148.134:32001=6, ok_sock_to_host_127.0.0.1:8080=5, ok_permit_to_host_acquired_127.0.0.1:8443=5, ok_sock_to_host_real_open_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=2, ok_sock_to_host_real_open_10.205.148.134:32001=2, ok_permit_to_host_acquired_10.205.148.134:32001=6, fail_sock_to_host_127.0.0.1:8443=5, ok_permit_to_host_released_127.0.0.1:8080=5, ok_sock_to_host_real_close_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=2, ok_sock_to_host_real_close_10.205.148.134:32001=2, ok_sock_to_host_close_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=6, ok_sock_to_host_real_open_127.0.0.1:8080=5, ok_sock_to_host_real_close_127.0.0.1:8080=5, ok_sock_to_host_close_127.0.0.1:8080=5, ok_permit_to_host_released_127.0.0.1:8443=5, ok_permit_to_host_released_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=6, ok_permit_to_host_acquired_ssl1zn3-m1-ap.ssodev-bo.mtv1.vrsn.com:32001=6, ok_permit_to_host_acquired_127.0.0.1:8080=5, ok_permit_to_host_released_10.205.148.134:32001=6}';
$subst = "\"\1\":\2\3";
$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