Transform a class exp into an actual regex

def _compile(self, expression):
        """
        Transform a class exp into an actual regex
        """

        x = self.RE_PYTHON_VAR.sub('(?:\\1,)', expression)
        x = self.RE_SPACES.sub('', x)
        return re.compile(x)