'Moves pattern in the path format string or strips it
text -- text to handle
pattern -- regexp pattern (case ignore is already on)
strip -- if True, pattern will be removed'

def unthe(self, text, pattern):

    if text:
        r = re.compile(pattern, flags=re.IGNORECASE)
        try:
            t = r.findall(text)[0]
        except IndexError:
            return text
        else:
            r = re.sub(r, '', text).strip()
            if self.config['strip']:
                return r
            else:
                fmt = self.config['format'].as_str()
                return fmt.format(r, t.strip()).strip()
    else:
        return u''
