Index: Statement.php =================================================================== --- Statement.php (revision 17563) +++ Statement.php (working copy) @@ -184,10 +184,10 @@ // get a version of the SQL statement with all quoted // values and delimited identifiers stripped out // remove "foo\"bar" - $sql = preg_replace("/$q($qe|\\\\{2}|[^$q])*$q/", '', $sql); + $sql = preg_replace("/$d($de+|\\\\{2}+|[^$d]+)*$d/", '', $sql); // remove 'foo\'bar' if (!empty($q)) { - $sql = preg_replace("/$q($qe|[^$q])*$q/", '', $sql); + $sql = preg_replace("/$q($qe+|\\\\{2}+|[^$q]+)*$q/", '', $sql); } return $sql;