def split3(text, pat1, pat2):
    """Split text in 3 parts: before pat1, between, and after pat2."""
    part1, text = text.split(pat1, 1)
    part2, part3 = text.split(pat2, 1)
    return part1, part2, part3