def METHOD_NAME(self, text_filter):
    if hasattr(self._proxy, "setFilterRegExp"):
        self._proxy.setFilterRegExp(text_filter)
    else:
        self._proxy.setFilterRegularExpression(text_filter)