diff --git a/query.class.php b/query.class.php index f7afafb..c2d9567 100644 --- a/query.class.php +++ b/query.class.php @@ -720,7 +720,7 @@ class PDOSQLiteDriver { */ private function rewrite_between() { if (!$this->rewrite_between) return; - $pattern = '/\\s*(CAST\(.+?\)|[^\\s\(]*)?\\s*BETWEEN\\s*([^\\s]*)?\\s*AND\\s*([^\\s\)]*)?\\s*/ims'; + $pattern = '/\\s*(CAST\([^\)]+?\)|[^\\s\(]*)?\\s*BETWEEN\\s*([^\\s]*)?\\s*AND\\s*([^\\s\)]*)?\\s*/ims'; while (preg_match($pattern, $this->_query, $match)) { $column_name = trim($match[1]); $min_value = trim($match[2]);