def postchomp(regex, prefix):
    regex = re.compile(regex)

    def strip(text, postlines):
        match = regex.match(text)
        if match:
            text = (prefix + text[match.end():])
            postlines += match.group().count('\n')
        return (text, postlines)
    return strip
def postchomp(regex, prefix):
    regex = re.compile(regex)

    def strip(text, postlines):
        match = regex.match(text)
        if match:
            text = (prefix + text[match.end():])
            postlines += match.group().count('\n')
        return (text, postlines)
    return strip