Fixed sre_constants.error for query with special chars.