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