import re


def split_varstring(varstring):
    """Splits a variable string containing branch names into a list with
    the single-colon as a delimiter.  Cannot simply use str.split()
    because functions like TMath::sin inject double colons into
    varstring.
    """
    # This regex checks that there are no colons before and after the
    # single colon
    return re.split('(?<!:):(?!:)', varstring)