fork download
  1. <?php
  2.  
  3. $str = 'Hello\"';
  4. echo preg_replace('/^(?:\\\\")?(.*?)(?:\\\\")?$/', '\"$1\"', $str);
  5.  
Success #stdin #stdout 0.01s 52488KB
stdin
Standard input is empty
stdout
\"Hello\"