parse a string to a delta
    'all' is represented by None

def parse_delta(s):
    """
    parse a string to a delta
    'all' is represented by None
    """
    if s == 'all':
        return None
    else:
        ls = delta_regex.findall(s)
        if len(ls) == 1:
            return relativedelta(**{delta_chars[ls[0][1]]: int(ls[0][0])})
        else:
            raise ValueError('Invalid delta string: %s' % s)