Helper function for extract_values,
    figures out string length from format string.

def _get_number_from_fmt(fmt):
    """
    Helper function for extract_values,
    figures out string length from format string.
    """
    if '%' in fmt:
        # its datetime
        return len(("{0:" + fmt + "}").format(dt.datetime.now()))
    else:
        # its something else
        fmt = fmt.lstrip('0')
        return int(re.search('[0-9]+', fmt).group(0))