怎么删除不了帖子?vbs脚本出错?我搞错了,\0才会被转义。你选择对字符 0、a、b、f、n、r、t 和 v 进行转义时需要小心,它们将被转换成 \0、\a、\b、\f、\n、\r、\t 和 \v。在 PHP 中,只有 \0(NULL)、\r(回车符)、\n(换行符)和 \t(分隔符)是预定义的转义序列, 而在 C 中,上述的所有转换后的字符都是预定义的转义序列。 然而这个问题的确暂时很困扰。

解决方案 »

  1.   

    晕死,难道\后跟的数字统统都被解释为一个字符了?
    \67得到7
    \670得到不知名的字符?$current = 'D:\web\mambog_corp\sql\67-12-23';
    $current = preg_replace("#\\([0-9])#i", "/\\1", $current);
      

  2.   

    $current = 'D:\web\mambog_corp\sql\67-12-23';
    $current = preg_replace("#\\\([0-9]+)#i", "/\\1", $current);
      

  3.   

    '\' and '\\' will both end up as a single '\' in the string which
    effectively reads \( to the preg parser which means you escape the '('
    and so don't use it's function to capture characters for backreferences
    which renders the following ')' illegal since it tries to close a not
    opened '('. Therefore, \ -> \ and \\ -> \ so you need \\\ to get \\ in
    the string so you don't escape the (. Clear ? :)http://bugs.php.net/bug.php?id=16537&edit=1
      

  4.   

    原来问题发生在变量的传送过程中。
    双引号括起的字符串中含有的\,在变量传递过程中,会被系统默认处理。\200就被处理成了那个貌似字母e被穿了一刀的样子的字符。靠。所以要用单引号。或者对所有\再加个\变成\\$current = "D:\web\mambog_corp\sql\2005-12-23";
    $current = preg_replace("#\\([0-9])#i", "/\\1", $current);