fork download
  1. <?php
  2.  
  3. $string = <<<DATA
  4. #TEST string "quoted part\" witch escape" other "quoted string"
  5. DATA;
  6.  
  7. $regex = '~\\\\[\'"](*SKIP)(*FAIL)|["\']~';
  8.  
  9. $string = preg_replace($regex, '', $string);
  10. echo $string;
  11.  
  12. ?>
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
#TEST string quoted part\" witch escape other quoted string