fork(1) download
  1. <?php
  2. $str = '"z":"100", "a":"+0.5", "b":"-0.578", "c":"-.5", "d":".55", "e":"-5", "f":"01234", "g":"0.999", "i":"153.35"';
  3. $pattern = '/"(?!0\d+")\+?(-?(?:\d*\.)?\d+)"/';
  4. print(preg_replace($pattern, '$1', $str));
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
"z":100, "a":0.5, "b":-0.578, "c":-.5, "d":.55, "e":-5, "f":"01234", "g":0.999, "i":153.35