All pastes #37072 Raw Edit

Something

public python v1 · immutable
#37072 ·published 2006-01-17 14:22 UTC
rendered paste body
def parsePipe(data):    """    Parses pipe-separated fields and handles escaped piped. Escape character    is backslash.    """    ret = []    splitted = data.split("|")    for s in splitted:        if ret and ret[-1].endswith("\\"):            ret[-1] = "%s|%s"%(ret[-1][:-1], s)        else:            ret.append(s)    return ret