<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _isValidQuery(self, query, mode="phonefy"):
 """ Method to verify if a given query is processable by the platform. The system looks for the forbidden characters in self.Forbidden list. Args: ----- query: The query to be launched. mode: To be chosen amongst mailfy, phonefy, usufy, searchfy. Return: ------- True | False """

        try:
            # Suport for version 2 of wrappers
            validator = self.modes[mode].get("query_validator")
            if validator:
                try:
                    compiledRegexp = re.compile(
                        "^{expr}$".format(
                            expr=validator
                        )
                    )
                    return compiledRegexp.match(query)
                except AttributeError as e:
                    return True

        except AttributeError as e:
            # Legacy for mantaining old wrappers
            compiledRegexp = re.compile("^{r}$".format(r=self.validQuery[mode]))
            return compiledRegexp.match(query)