Escape mechanism for string queries