<?php $str = 'Hello\"';echo preg_replace('/^(?:\\\\")?(.*?)(?:\\\\")?$/', '\"$1\"', $str);
Standard input is empty
\"Hello\"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!