def get_tag_value(tag_string, format_string, sample_string):
    """Returns the value of the tag in a given sample."""
    split_format_string = format_string.split(':')

    # find the position of the tag specified
    tag_index = 0
    found_tag = False
    for tag in split_format_string:
        if tag == tag_string:
            found_tag = True
            break
        tag_index += 1

    if found_tag:
        split_sample_string = sample_string.split(':')

        return split_sample_string[tag_index]
    else:
        return None