diff --git a/src/qExpr.cpp b/src/qExpr.cpp
index 6a20b1f..0841f62 100644
--- a/src/qExpr.cpp
+++ b/src/qExpr.cpp
@@ -1812,14 +1812,26 @@ bool ibis::qContinuousRange::overlap(double lo, double hi) const {
     return ret;
 } // ibis::qContinuousRange::overlap
 
-/// The constructor of qString.  It copies the two string arguments.
+/// The constructor of qString.  The string may contain meta character '\'
+/// that is used to escape the quote and other characters.  The meta
+/// character will also be striped.
 ibis::qString::qString(const char* ls, const char* rs) :
-    qExpr(ibis::qExpr::STRING), lstr(ibis::util::strnewdup(ls)),
-    rstr(ibis::util::strnewdup(rs)) {
-#if DEBUG+0 > 0 || _DEBUG+0 > 0
-    LOGGER(ibis::gVerbose > 5)
-	<< "qString::ctor(\"" << ls << "\", \"" << rs << "\") ...";
-#endif
+    qExpr(ibis::qExpr::STRING), lstr(ibis::util::strnewdup(ls)) {
+    // need to remove leading and trailing quote and the meta characters
+    rstr = new char[1+strlen(rs)];
+    const char* cptr = rs;
+    char* dptr = rstr;
+    while (*cptr != 0) {
+	if (*cptr != '\\') {
+	    *dptr = *cptr;
+	}
+	else {
+	    ++cptr;
+	    *dptr = *cptr;
+	}
+	++cptr; ++dptr;
+    }
+    *dptr = 0; // terminate rstr with the NULL character
 }
 
 void ibis::qString::print(std::ostream& out) const {
@@ -1837,12 +1849,26 @@ void ibis::qString::getTableNames(std::set<std::string>& plist) const {
 
 /// Constructor.
 ibis::qLike::qLike(const char* ls, const char* rs) :
-    qExpr(ibis::qExpr::LIKE), lstr(ibis::util::strnewdup(ls)),
-    rpat(ibis::util::strnewdup(rs)) {
+    qExpr(ibis::qExpr::LIKE), lstr(ibis::util::strnewdup(ls)) {
 #if DEBUG+0 > 0 || _DEBUG+0 > 0
     LOGGER(ibis::gVerbose > 5)
 	<< "qLike::ctor(\"" << ls << "\", \"" << rs << "\") ...";
 #endif
+    // need to remove leading and trailing quote and the meta characters
+    rpat = new char[1+strlen(rs)];
+    const char* cptr = rs;
+    char* dptr = rpat;
+    while (*cptr != 0) {
+	if (*cptr != '\\') {
+	    *dptr = *cptr;
+	}
+	else {
+	    ++cptr;
+	    *dptr = *cptr;
+	}
+	++cptr; ++dptr;
+    }
+    *dptr = 0; // terminate rpat with the NULL character
 }
 
 void ibis::qLike::print(std::ostream& out) const {
