preg_replace with backslash, dollar sign and double quote
Posted: Sun Nov 03, 2002 9:35 pm
$str = '\\\\$hello \\\"world';
$str = preg_replace("/\\\*\$/","\$",$str);
$str = preg_replace("/\\\*\"/","\"",$str);
print $str;
output :
$hello "world$
but what i expect is \$hello \"world
any problem with my regular expression?
$str = preg_replace("/\\\*\$/","\$",$str);
$str = preg_replace("/\\\*\"/","\"",$str);
print $str;
output :
$hello "world$
but what i expect is \$hello \"world
any problem with my regular expression?