def get_between(haystack, starter, ender):
    """
    Find text between a start flag and end flag. Get the location of the
    desired substring and the location of the entire
    field separately.

    Example:
    If starter is "line " and ender is " " and haystack contains
    "line 1 ", then the result is a dict where:
    result_i and result_end define a slice of haystack that is equal to
    "value" string in the returned dict, and field_i and field_end are
    the slice values for the entire field including starter and ender.
    - If haystack does not contain starter ender after it, then the
      return will have None for the value of "value".
    """
    result_i = None
    result_end = None
    field_i = None
    field_end = None
    value = None
    field_i = haystack.find(starter)
    if field_i > -1:
        result_end = haystack.find(ender, field_i + len(starter))
        if result_end > 0:
            result_i = field_i + len(starter)
            field_end = result_end + len(ender)
            value = haystack[result_i:result_end]
    return {
        "result_i": result_i,
        "result_end": result_end,
        "field_i": field_i,
        "field_end": field_end,
        "value": value
    }